justinmk / vim-sneak

The missing motion for Vim :athletic_shoe:
http://www.vim.org/scripts/script.php?script_id=4809
MIT License
3.26k stars 88 forks source link

fall-through keypress reduces labels to normal highlighted matches #279

Closed BertrandSim closed 3 years ago

BertrandSim commented 3 years ago

When using label mode, a "fall through" keypress reduces labels to normal highlighted matches (ie. the matches are displayed like in sneak's normal-mode), instead of all labels / matches being removed

We can reproduce this with the following configuration. For emphasis, let us customize the highlight groups for 'SneakLabel' and 'Sneak'.

" label mode
let g:sneak#label = 1

" highlighting
highlight link SneakLabel Identifier
highlight link Sneak Statement

Suppose I have the following buffer text, with the cursor on 'a' on the first line

abcdef
abcdef
abcdef
  1. Sneak for de so as to show the labels. The cursor jumps to the first occurence
  2. With the labels still showing, press any key that does not move the cursor (such as d,c,y,g,z)
  3. The labels are removed. While the matches for de are no longer highlighted with the SneakLabel group, they are now highlighted with the 'Sneak' highlight group

Ideally, the fall through keypress should either (a) remove all sneak highlights, or (b) preserve the labels as-is. Judging from the documentation (sneak-fallthrough), my guess is that (a) is what was intended.