tednaleid / sublime-EasyMotion

Sublime Text 2 plugin to quickly jump to any character in the visible area of the active view.
Apache License 2.0
386 stars 24 forks source link

Fix: scroll view to the chosen region #23

Closed laughedelic closed 11 years ago

laughedelic commented 11 years ago

The problem is that if cursor is outside of the visible area and you want to jump to a region inside visible area, it places cursor on that region, but view is scrolled to the place, where it was before.

I've just added self.view.show(winning_region to scroll to the chosen region.

tednaleid commented 11 years ago

In what situations would the cursor be outside of the viewable area? It should only highlight those characters that are in the viewable area (unless the character is under the text input box that comes up, and I've got a fix I'm working on for that in the 013_implement_mode branch, but there's more work to do there).

Does this do something additionally that I'm missing? From what I've seen, it doesn't seem to hurt anything to have this, I'm just wondering if there are use cases (maybe with already highlighted text?) that I'm not understanding.

laughedelic commented 11 years ago

No, it isn't anything special. My use case is that I may scroll somewhere in a big file, just viewing it, and then I want to place cursor on a position in that area and I don't want to point it with mouse, because that what this plugin is for.

tednaleid commented 11 years ago

Ah! I see, I hadn't ever used it where I've scrolled the view to somewhere when the cursor isn't actually already in the viewable area. That makes sense and this patch is a useful one then. I'll merge this, and I can also merge in the other one you had to fix the stacktrace in the console.

thanks!

laughedelic commented 11 years ago

Cool. thanks for your plugin! It's great.