DanilaMihailov / beacon.nvim

Whenever cursor jumps some distance or moves between windows, it will flash so you can see where it is
339 stars 9 forks source link

Ignore command-line window #12

Closed jemag closed 4 years ago

jemag commented 4 years ago

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 4 years ago
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

DanilaMihailov commented 4 years ago

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 :)

Remich commented 4 years ago

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
DanilaMihailov commented 4 years ago

Oh, are you using neovim 0.5?

Remich commented 4 years ago

Yes, NVIM v0.5.0-553-gd8c5d122f

DanilaMihailov commented 4 years ago

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.

DanilaMihailov commented 4 years ago

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 :)

Remich commented 4 years ago

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.

DanilaMihailov commented 4 years ago

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

DanilaMihailov commented 4 years ago

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 :)

Remich commented 4 years ago

Great, thx!