Sublime Forum

Finding text in folded code should expand folded code

#1

Hi, longtime paid sublime text lover and first time poster!

I wanted to share an annoyance I’ve experienced for a while - when searching through a file with folded code, sublime will reveal the code upon find, but when trying to click the area find is revealing within a folded code section, the code goes back to a folded state. I feel like this is a bit frustrating and makes the user perform more actions (i.e. then then have to go back and unfold the section first, then redo the find - this gets much more frustrating in very large files).

To compare, I would expect folded code to stay expanded if a find action discovers a folded area. Other editors like xcode do it this way.

Is there an option or any plugin hack to make code folding be a bit more ‘sloppy’ when working with find?

To compare, here’s both xcode (top) and sublimetext (bottom):

0 Likes

#2

I tried this in my Sublime and the folded section of code stayed expanded… it doesn’t behave as shown in your example. What version of Sublime are you using? I’m on 3175.

0 Likes

#3

it also works as expected for me, unfolding the code when the selection moves into it and staying expanded when moving out. Tested on Linux and Windows with build 3175.

0 Likes

#4

Interesting. I’m using Sublime build 3176 on macOS mojave, but feel like I’ve encountered this issue for a very long time. Will see if this happens on windows / eventually try with plugins disabled.

0 Likes