vim:aucmd: Fix missing w:cword_timer_id error msg

This commit is contained in:
2024-10-16 10:44:19 +02:00
parent 8a101134c7
commit dd5663b564

View File

@@ -78,7 +78,11 @@ endfunction
function! _HighlightCurrentWord(timer_id)
" TODO: there is probably some kind of race condition here
unlet w:cword_timer_id
" NOTE: w:cword_timer_id can be unset when switching from a window that is
" currently in visual mode as then the ModeChanged event is triggered.
if exists('w:cword_timer_id')
unlet w:cword_timer_id
endif
let l:cword = expand('<cword>')
if exists('w:old_cword') && w:old_cword == l:cword