From bdbeada7aada64c0d06d118395c6486263b95d5e Mon Sep 17 00:00:00 2001 From: Julian Prein Date: Wed, 25 Sep 2024 14:11:13 +0200 Subject: [PATCH] vim:aucmd: Fix display of selection size indicator Fixes: 29928505ff45 ("vim:aucmd:TODO: Fix display of selection size") --- .config/vim/vimrc.d/80-autocommands.vim | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.config/vim/vimrc.d/80-autocommands.vim b/.config/vim/vimrc.d/80-autocommands.vim index bfe538a..53b9626 100644 --- a/.config/vim/vimrc.d/80-autocommands.vim +++ b/.config/vim/vimrc.d/80-autocommands.vim @@ -92,7 +92,12 @@ function! HighlightVisualSel() let l:old_reg = getreg('"') let l:old_regtype = getregtype('"') - silent! norm ygv + " NOTE: The yank needs to be silent to mute the 'n lines yanked' + " message. But the `silent` leads to the disappearance of the selection + " size indicator (:h 'showcmd'), thus `y` and `gv` need to be executed + " in separate normal mode commands. + silent normal y + normal gv if @" == "" " Abort when visual mode stated on an empty line @@ -134,7 +139,6 @@ function! ClearHighlights(what = s:CLEAR_HIGHS_ALL) endif endfunction -" TODO: this disables the display of the size of the selection (:h 'showcmd') augroup highlight_current au! au CursorMoved * if mode() == 'n' |