DanilaMihailov/beacon.nvim

Ignore command-line window

Closed this issue · 11 comments

jemag commented

When I trigger the command-line window, by pressing "q:" it always triggers this error from beacon.nvim:

Error detected while processing function <SNR>53_Cursor_moved[22]..<SNR>53_Highlight_position[16]..<SNR>53_Clear_highlight:
line   10:
E5555: API call: E11: Invalid in command-line window; <CR> executes, CTRL-C quits

Is there anything I can do to make beacon ignore the command-line window?

jemag commented
augroup beacon_toggle
  autocmd!
  autocmd CmdwinEnter,CmdlineEnter * let g:beacon_enable=0
  autocmd CmdwinLeave,CmdlineLeave * let g:beacon_enable=1
augroup END

Seems to work. Just wondering if it is possible to do it with just g:beacon_ignore_filetypes or
g:beacon_ignore_buffers

You should be able to ignore it with g:beacon_ignore_buffers, but I will push fix shortly, that ignores this window by default.

Thanks for feedback :)

I still get that error:

Error detected while processing function <SNR>93_Fade_window[19]..<SNR>93_Clear_highlight:
line   11:
E5555: API call: E11: Invalid in command-line window; <CR> executes, CTRL-C quits

Oh, are you using neovim 0.5?

Yes, NVIM v0.5.0-553-gd8c5d122f

So i tried few ways of detecting if cursor is in command line window, and they all work in neovim 0.4 and vim 8.2. But do not work in neovim 0.5. It may be bug in neovim, but I'am still looking for solution.

I actually fixed it! Added few more checks and now it works! I pushed straight to master, so you can update plugin and check it out. Tell me if it is still not working :)

Yes and no.
When there is a highlight fading out and I quickly jump to the Command Line Window, I still get that error. For example when switching to another window and then immediately opening the Command Line Window.
But in every other case the error does not show up anymore.

Yeah, I see that now, even in neovim 0.4. Will look into it more, weird tho :)

So I fixed it again :D

But old highlight stays visible while you in command line window, I hope I can fix that too. For now you can update plugin and it should work.

Something weird happening in command line window, I hope I can fix it better, for now this is just few additional checks and it does not look very good.

Thanks for feedback :)

Great, thx!