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).
This commit is contained in:
@@ -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('<cword>') != '')
|
||||
let w:old_cword = expand('<cword>')
|
||||
|
||||
Reference in New Issue
Block a user