Skip to content

Conversation

@tuurep
Copy link
Contributor

@tuurep tuurep commented Nov 28, 2025

I researched the inclusive = 0 problems in #322 (comment), and definitely think the way SneakCurrent is done can't be used with inclusive = 0 motions, for example:

forward backwards

with 2-char exclusive sneak (most importantly where it higlights the q on backwards motion).

IMO this is sufficient as a fix,

though it's possible to fix it so that the hl is on the right spot on exclusive too, I just think it would look uglier on the t-motion (<Plug>Sneak_t, 1 char), so all we'd achieve would be to add more visual noise to a common motion.

P.S. in #322 I was very confused about where exactly the cursor should land on a backwards exclusive motion when match is longer than 1 char, but I think #83 mostly explains it so I suppose there are no more problems from #322

Use of SneakCurrent with inclusive=0 (t-like) motion wasn't considered
properly:

  - The semantics are that it's like a search highlight for "match under
    cursor", but exclusive motion lands the cursor *next* to the match

  - SneakCurrent's implementation assumes the cursor is at match start
    when the highlight is shown, which caused a hl bug extending the hl
    beyond the match on exclusive
@tuurep tuurep force-pushed the disable-sneakcurrent-in-exclusive-motion branch from edf6a1b to 942f158 Compare November 28, 2025 08:15
@justinmk
Copy link
Owner

This makes sense. Thank you!

@justinmk justinmk merged commit 2727c62 into justinmk:master Nov 29, 2025
@tuurep tuurep deleted the disable-sneakcurrent-in-exclusive-motion branch December 2, 2025 00:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants