Iâm working on a plugin called SublimeJump (https://github.com/tednaleid/SublimeJump) that lets the user jump to any visible character in the view with a couple of keystrokes. Itâs very similar to EasyMotion (vim) or AceJump (emacs/intellij) if youâre familiar with those.
Iâve got most of the functionality working but Iâm stumped on how to get it to respect folded areas of code. Currently it lets you jump to folded areas which it should not do.
The documented API gives us View.visible_region()
which returns a Region with the starting and ending characters on the view. As itâs a range, it doesnât remove those areas of code that are folded.
The documented API doesnât give any way to query for the folded areas that I can see. Unless there is a key that I can use to retrieve them from View.get_regions(key)
?
If there is a way for me to get the folded regions in the visible_region, I could easily create a list of Regions out of them that really only decorates the truly visible text with jump targets.