Closed tuurep closed 1 year ago
I've gotten used to the
vim-cool
-train of thought that all Search highlights clear on the first cursormove so it'd be nice if I could reduce the CursorMoved to just the first.
Not sure what you mean. The "first" move is done internally by sneak, which is why the nested handler is used (although maybe that could be simplified, possibly by moving the s:attach_autocmds() call later. (edit: doesn't work)
But in any case, as a user you should only have to move the cursor once. Maybe some other plugin is interfering.
If you're referring to the non-label-mode behavior where hitting ;
doesn't clear the highlights... you can call sneak#cancel()
from a <Plug>Sneak_;
mapping.
That also raises the question, why have highlights at all for non-label-mode? To disable highlights see :help sneak-highlight
:
To disable highlighting:
highlight link Sneak None
" Needed if a plugin sets the colorscheme dynamically:
autocmd User SneakLeave highlight clear Sneak
But in any case, as a user you should only have to move the cursor once. Maybe some other plugin is interfering.
Hey thanks a lot, after reading this I tried with a minimal config and indeed I was wrong in my post.
The setting that caused this bug was:
let g:loaded_matchparen = 0
which I have had in my configs forever. What a weird interference, does that give you any idea of a bug?
As a workaround I can load matchparen and set MatchParen
highlight group to None
~Sneak clears its highlights after 2 CursorMove events.~ ^ This happens if you have
let g:loaded_matchparen = 0
or disable matchparen withLazy.nvim
I've gotten used to the
vim-cool
-train of thought that all Search highlights clear on the first cursormove so it'd be nice if I could reduce the CursorMoved to just the first.It can sorta be achieved by un-nesting the autocmds in
plugin/sneak.vim
line272
However, I notice 2 issues:
,
or;
turns off highlighting at an inappropriate time. Most reproducible for me was to hold down,
but release it right before key repeat would start firing.Did you choose the 2-moves threshold for aesthetic reasons, or for something similar I encountered above?