ice9js / ace-jump-sublime

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

Fix jump error when exiting char mode without entering target #53

Closed bismarck2100 closed 7 years ago

bismarck2100 commented 7 years ago

I found that when using char mode, user will get an error after pressing esc without enter any target char. root cause: should check self.target before performing jump in char mode. Thanks.

ice9js commented 7 years ago

Nice catch, thanks!

Hovever, I'm not sure how this is supposed to fix that? It looks like you moved the condition up from inside AceJumpCommand.jump to where it is called, which shouldn't really change anything since it was the first thing inside the method.

Please correct me if I'm missing something.

bismarck2100 commented 7 years ago

Thanks for quick reply~

In my opinion, it's because AceJumpCharCommand override the jump function. When "jump" function is called in AceJumpCommand.submit , AceJumpCharCommand.jump will be invoked.

Thanks.

ice9js commented 7 years ago

Oh right, that makes sense. Thanks a lot!