3

I need to preserve the sub-foldings on folding/unfolding the mother (super) ones. when unfold a Class through Ctrl+Shift+]. it will unfold its fold Functions as well. is it possible to Unfold only parent class instead of applying to its sub child.

In the attached image, after fold this Class when you unfold it, it will unfold its Function as well.

Code scenario Example

OdatNurd
  • 21,371
  • 3
  • 50
  • 68
  • You can check here: [Sublime3 Fold/Unfold methods](https://stackoverflow.com/questions/34958855/sublimetext3-fold-unfold-all-methods) – bhavinjr Apr 03 '19 at 10:29
  • I don't think that is related to `laravel` you should remove that tag – bhavinjr Apr 03 '19 at 10:30

1 Answers1

0

The short answer to this is that I believe you would require a plugin to perform this kind of action; there may or may not be one already available on Package Control, I'm not sure.

The longer answer is that the commands that fold and unfold text (which are exposed via key bindings, the menu and the fold arrows in the gutter) don't allow for folded sections to overlap.

Essentially, any character in the file can be considered folded or not folded; so once you fold an area, everything inside of it is considered to be folded. In your case that means that when you fold the parent class, the information that the methods were also already folded is lost, so they're no longer folded when you unfold the parent.

To get around that, a plugin would have to try and remember the state of folded regions so that it could unfold things partially instead.

OdatNurd
  • 21,371
  • 3
  • 50
  • 68