Code Folding: opening on its own. Stateful fold request

I've been noticing that I will occasionally jump out of JetBrains and when I come back, code sections I had collapsed are suddenly expanded without my having done anything to cause it.

Aside from that, I would like to be able to define items to have collapsed by default when I open a file, or restart the IDE.

Would it be possible for the custom region folding to support an attribute that would define whether a region is collapsed or expanded when the file is loaded?

5 comments

You could use: Settings -> IDE-Settings -> Editor -> Code Folding

0

Which is useful, but it is not the same as being able to define custom regions that will be collapsed. Or in the case of things collapsed by default to have them expanded.

0

devnuhl wrote:

Would it be possible for the custom region folding to support an attribute that would define whether a region is collapsed or expanded when the file is loaded?


I recommend you vote for and follow http://youtrack.jetbrains.com/issue/IDEA-85517

0

IDEA supports NetBeans-style custom folding regions (https://ui.netbeans.org/docs/ui/code_folding/cf_uispec.html#custom) and their 'defaultstate' attribute. That looks like what you need.

0

This looks like something I've stumbled onto and tried in PHPStorm, and it did not seem to work. Perhaps it was something on my end, and I need to try it again, but the last time I used that, it did not work for me in the instances where it was used.

0

Please sign in to leave a comment.