I use the relative numbering feature of vim only in the active buffer. Every time I switch the buffer relative numbering is enabled in the new buffer and disabled in the old one. The same is true if editing starts. Then relative numbering is switched off. After editing is finished relative numbering is turned on.
Describe the bug
Using :set relativenumber and :set norealtivenumber lets the whole screen flash.
To Reproduce
vim --clean <file>Expected behavior
Just the numbering is changed in steps 3 and 4. The text should not be redrawn.
Environment:
VIM - Vi IMproved 8.1 (2018 May 18, compiled Jun 28 2019 09:33:25)
Included patches: 1-1602
Modified by <bugz...@redhat.com>
Compiled by <bugz...@redhat.com>
Huge version without GUI. Features included (+) or not (-):
+acl -farsi -mouse_sysmouse -tag_any_white
+arabic +file_in_path +mouse_urxvt -tcl
+autocmd +find_in_path +mouse_xterm +termguicolors
+autochdir +float +multi_byte +terminal
-autoservername +folding +multi_lang +terminfo
-balloon_eval -footer -mzscheme +termresponse
+balloon_eval_term +fork() +netbeans_intg +textobjects
-browse +gettext +num64 +textprop
++builtin_terms -hangul_input +packages +timers
+byte_offset +iconv +path_extra +title
+channel +insert_expand +perl/dyn -toolbar
+cindent +job +persistent_undo +user_commands
-clientserver +jumplist +postscript +vartabs
-clipboard +keymap +printer +vertsplit
+cmdline_compl +lambda +profile +virtualedit
+cmdline_hist +langmap +python/dyn +visual
+cmdline_info +libcall +python3/dyn +visualextra
+comments +linebreak +quickfix +viminfo
+conceal +lispindent +reltime +vreplace
+cryptv +listcmds +rightleft +wildignore
+cscope +localmap +ruby/dyn +wildmenu
+cursorbind +lua/dyn +scrollbind +windows
+cursorshape +menu +signs +writebackup
+dialog_con +mksession +smartindent -X11
+diff +modify_fname -sound -xfontset
+digraphs +mouse +spell -xim
-dnd -mouseshape +startuptime -xpm
-ebcdic +mouse_dec +statusline -xsmp
+emacs_tags +mouse_gpm -sun_workshop -xterm_clipboard
+eval -mouse_jsbterm +syntax -xterm_save
+ex_extra +mouse_netterm +tag_binary
+extra_search +mouse_sgr -tag_old_static
system vimrc file: "/etc/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
defaults file: "$VIMRUNTIME/defaults.vim"
fall-back for $VIM: "/etc"
f-b for $VIMRUNTIME: "/usr/share/vim/vim81"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -L. -Wl,-z,relro -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fstack-protector-strong -rdynamic -Wl,-export-dynamic -Wl,--enable-new-dtags -Wl,-z,relro -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,-z,relro -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -L/usr/local/lib -Wl,--as-needed -o vim -lm -lselinux -lncurses -lacl -lattr -lgpm -ldl -Wl,--enable-new-dtags -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fstack-protector-strong -L/usr/local/lib -L/usr/lib64/perl5/CORE -lperl -lpthread -lresolv -ldl -lm -lcrypt -lutil -lc
Additional context
I have been using this configuration for about a year but the flashing only started recently. I think it started with the update from Fedora 29 to 30. But it seems they use the same vim version.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
The same issue as above, because I use the following autocmds to toggle the relativenumber option:
set number relativenumber autocmd InsertEnter * setlocal norelativenumber autocmd InsertLeave * setlocal relativenumber
This looks like the version of the last two months has this problem.
I can try, but there was no patch attached.
—
You are receiving this because you commented.
See this: https://groups.google.com/d/msg/vim_dev/00yUHYHlP-c/Gf-ZVci9BgAJ
—
You are receiving this because you commented.
Yes, I can download it there. I am in the progress of compiling.
—
You are receiving this because you commented.
Yes the patch works. I did the following:
git clone vim
cd vim/src
make
export VIMRUNTIME=/usr/share/vim/vim81
./vim option.c
<verified that I see the blinking/screen redraw>
patch -p2 < sign_refresh.diff
make
./vim option.c
<verified that the blinking/screen redraw no longer happens>
The patch did not apply on the master cleanly. The changes in the options I had to do manually. Here is my diff:
sign_refresh_master.txt
—
You are receiving this because you commented.
You are welcome, which vim release will have the patch and when will it probably come out?
—
You are receiving this because you commented.
—
You are receiving this because you commented.