From 9abf215871bf521212e7dc2745526d07fc4e543e Mon Sep 17 00:00:00 2001 From: Julian Prein Date: Tue, 6 Dec 2022 15:34:33 +0100 Subject: [PATCH] vim:autocommands: Reset old_cword when deleting When deleting the match, w:old_cword has to be unset as well. Otherwise it can happen that it is not properly readded (e.g. when moving from a word to an empty line and then back to the same word). --- .config/vim/vimrc.d/80-autocommands.vim | 1 + 1 file changed, 1 insertion(+) diff --git a/.config/vim/vimrc.d/80-autocommands.vim b/.config/vim/vimrc.d/80-autocommands.vim index af29e5c..5de5ef1 100644 --- a/.config/vim/vimrc.d/80-autocommands.vim +++ b/.config/vim/vimrc.d/80-autocommands.vim @@ -60,6 +60,7 @@ function! HighlightCurrentWord() if exists('w:cword_match_id') call matchdelete(w:cword_match_id) unlet w:cword_match_id + unlet w:old_cword endif if (expand('') != '') let w:old_cword = expand('')