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.