ice9js / ace-jump-sublime

Jump between characters in Sublime Text 3 without using a mouse at ease
MIT License
202 stars 31 forks source link

Input a non-matched character then cancel loses cursor position #48

Closed novadev94 closed 8 years ago

novadev94 commented 8 years ago

Hi,

It looks like the cursor position is loss after trying to jump to a non-matched character and then cancel (by pressing Escape or entering random letter). This works fine with any matched character, just the non-matched ones don't work, this behavior is a little bit annoying.

System Configuration

Sublime Text: Version 3 dev build 3119 Ace Jump: Version 1.5.0 (installed with package control) Vintage/Vintageous: No

To Reproduce

  1. Having a text of something like "Hello World".
  2. Put the cursor somewhere in the text.
  3. Hit key combination for Character jump (other modes don't work too).
  4. Enter v (non-matched character). No match is found, no highlight is shown.
  5. Press Esc or any character.
  6. Cursor doesn't go back to its original position.
kypi commented 8 years ago

Under add_labels(), commenting out "clear_views_sel(self.all_views)" fixes this. Not sure if this introduces other bugs, though.

ice9js commented 8 years ago

This makes sense as all of your current selections and cursors are removed so they don't interfere when the labels are shown, but they are never restored. So a solution might be to store the current cursor positions before they're removed, so they can be restored after the jump for all views but the one that was selected.

If there's no one willing to try and fix it themselves, I'll try to find some time for this this week, as I have to admit this issue can be quite annoying sometimes.