yangmillstheory / vim-snipe

MIT License
118 stars 8 forks source link

t and T doesn't work in some cases #23

Closed ghost closed 6 years ago

ghost commented 6 years ago

Given the line ** t and T doesn't always work. It seems to need at least 2 chars which don't match the target on the left (for t) or the right (for T). ie. this works:

ab****

if you put the cursor on a and press t, but not if you put the cursor on b. F and f seem fine.

yangmillstheory commented 6 years ago

What mappings are you using?

I'm not sure what you mean by * - is that a wildcard or the actual character? If the latter, I'm guessing this is due to * being already mapped by vim (:h star), though this doesn't immediately explain why f and F work.

For the record I can repro this with ***, the effect is that no jump tokens are highlighted.

yangmillstheory commented 6 years ago

So this has nothing to do with *; I can reproduce the issue with

The place to start looking would be https://github.com/yangmillstheory/vim-snipe/blob/master/autoload/snipe/core.vim#L100.

vimeitor commented 6 years ago

I'm not sure if related, but jumping to a target (with t or f), undoing, going to the start of the line, and doing it again deletes the first target instead of showing all the targets available.

yangmillstheory commented 6 years ago

@vimeitor I don't think that's related, seems like it has more to do with the undo tree, but the code path is likely the same, or nearby. Can you file an issue?

yangmillstheory commented 6 years ago

This is still failing on aaaaa (doesn't highlight the second a).