vim-better-whitespace
vim-better-whitespace copied to clipboard
Error is silently logged when new window is opened
Error
Error detected while processing function <SNR>55_SetupAutoCommands[30]..<SNR>55_ClearHighlighting:
line 1:
E803: ID not found: 4
Steps to reproduce
- Install/activate this plugin
-
:redir @a
-
:new
(:split
also works) -
"ap
Specs
Windows 10 NVIM v0.5.0 - v0.8.0 (nightly)
Interesting. I can reproduce on vim 8.2 with a slightly different message:
Error detected while processing WinEnter Autocommands for "*"..function <SNR>43_SetupAutoCommands[11]..<SNR>43_HighlightEOLWhitespace[1]..<SNR>43_ClearHighlighting:
line 1:
E803: ID not found: 4
Actually that is an intentionally silenced message:
https://github.com/ntpeters/vim-better-whitespace/blob/c5afbe91d29c5e3be81d5125ddcdc276fd1f1322/plugin/better-whitespace.vim#L190-L192
I did not know that silenced messages appeared in redirected output. If you start vim with vim --cmd "redir @"
you’ll see that we also silence an error on opening vim. In any case there’s 2 tiny issues here:
- we use
s:
for the match ID but these ids are bound to windows, hence in a new window the existing id do not make sense -
matchdelete
does not accept-1
Reopening per #154