Closed stumash closed 2 years ago
sneak#cancel() checks if it exists in an <esc>
mapping, because that is how sneak normally supports its ESC behavior: https://github.com/justinmk/vim-sneak/blob/95374ad3e4b5ef902854e8f4bcfa9a7a31a91d71/plugin/sneak.vim#L64
It doesn't know that it didn't set this mapping itself. And it can't know, because Vim doesn't provide that info.
You can workaround this by calling sneak#cancel()
in a slightly different way:
nnoremap <esc> <esc>:call call('s'.'neak#cancel', [])<cr>:noh<cr>:<esc>
OTOH, perhaps sneak should do the hack to avoid this confusion.
If I map
<esc>
like soThen when I sneak around with, e.g.,
sXX
, I can hit<esc>
to stop showing the sneak highlighting.However, I'd also like
<esc>
to clear highlights from regular searching with/
. So, I doProblems is, if I search
/XX
once and then hit<esc>
, it clears the search highlights. But if I search/XX
a second time then hit<esc>
, it does not clear the search highlights. It does still clear sneak highlights though.Any idea what's going on?