diff --git a/.config/vim/vimrc.d/80-autocommands.vim b/.config/vim/vimrc.d/80-autocommands.vim index ab7310f..5cc2ca6 100644 --- a/.config/vim/vimrc.d/80-autocommands.vim +++ b/.config/vim/vimrc.d/80-autocommands.vim @@ -173,11 +173,12 @@ augroup highlight_current au CursorMovedI * call HighlightCurrentWord() au WinLeave * call ClearHighlights() au ModeChanged [vV\x16]*:* call ClearHighlights(s:CLEAR_HIGHS_VISUAL) | call HighlightCurrentWord() - " NOTE: HighlightVisualSel is not called here as I rarely need one-character - " highlighting and I can work around by moving back and forth once. - " TODO: are there situation where ModeChanged is triggered and the selection - " is immediately longer than one char without triggering CursorMoved? - au ModeChanged *:[vV\x16]* call ClearHighlights(s:CLEAR_HIGHS_CWORD) + " NOTE: HighlightVisualSel is not called when entering non-linewise visual + " mode as I rarely need one-character highlighting and I can work + " around by moving back and forth once. + " TODO: Fix for other ways of entering with a longer selection + au ModeChanged *:[v\x16]* call ClearHighlights(s:CLEAR_HIGHS_CWORD) + au ModeChanged *:V call ClearHighlights(s:CLEAR_HIGHS_CWORD) | call HighlightVisualSel() augroup END " When switching focus to another window, keep the cursor location underlined.