Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error is silently logged when new window is opened #152

Open
EtiamNullam opened this issue Jun 26, 2022 · 3 comments · Fixed by #153
Open

Error is silently logged when new window is opened #152

EtiamNullam opened this issue Jun 26, 2022 · 3 comments · Fixed by #153
Labels
enhancement waiting for merge a fix is proposed and needs to be reviewed

Comments

@EtiamNullam
Copy link

Error

Error detected while processing function <SNR>55_SetupAutoCommands[30]..<SNR>55_ClearHighlighting:
line    1:
E803: ID not found: 4

Steps to reproduce

  1. Install/activate this plugin
  2. :redir @a
  3. :new (:split also works)
  4. "ap

Specs

Windows 10
NVIM v0.5.0 - v0.8.0 (nightly)

@Cimbali
Copy link
Collaborator

Cimbali commented Jun 29, 2022

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

@Cimbali
Copy link
Collaborator

Cimbali commented Jun 29, 2022

Actually that is an intentionally silenced message:

function! s:ClearHighlighting()
silent! call matchdelete(get(s:, 'match_id', -1))
endfunction

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

@ntpeters
Copy link
Owner

Reopening per #154

@ntpeters ntpeters reopened this Jun 30, 2022
Cimbali added a commit to Cimbali/vim-better-whitespace that referenced this issue Jun 30, 2022
Cimbali added a commit to Cimbali/vim-better-whitespace that referenced this issue Jun 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement waiting for merge a fix is proposed and needs to be reviewed
Projects
None yet
3 participants