Feature Request: Fold All Levels Below


#1

I love code folding.

But there are times when I wish, for example, that when I select “Folding->Fold Level 2”, it could actually fold level 2 and all levels below that.

So then, if I manually unfold something, the levels below it remain folded.

Is this a possibility? Thanks.


#2

I don’t know that there’s an easy way to do it other than searching iteratively through the document for the deepest indent level (I can’t find an API method to tell you this) and then running editor.foldAllAtIndentLevel backwards until you get to the level you want to have unfolded.