From 551fde8f2b5f43d1f167b7ecef933e9f418855b8 Mon Sep 17 00:00:00 2001 From: Julian Prein Date: Mon, 4 Nov 2024 16:54:51 +0100 Subject: [PATCH] vim:au: Fix empty line selection in linewise-visual `highlight_selection()` is supposed to abort if the visual mode was started on an empty line. This was done correctly for charwise-visual but failed to do so in linewise-visual. --- .config/vim/vimrc.d/80-autocommands.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/vim/vimrc.d/80-autocommands.vim b/.config/vim/vimrc.d/80-autocommands.vim index f79b010..b870476 100644 --- a/.config/vim/vimrc.d/80-autocommands.vim +++ b/.config/vim/vimrc.d/80-autocommands.vim @@ -123,8 +123,8 @@ function! s:_highlight_selection(timer) silent normal y normal gv - if @" == "" - " Abort when visual mode stated on an empty line + if @" == "" || @" == "\n" + " Abort when visual mode started on an empty line return endif