Automatic folding not working

Answered

I have many files with `<editor-fold defaultstate="collapsed" desc="Generated Code">` regions and they never auto-fold. It seems that when I fold them manually, they are remembered, but if not folded, they stay unfolded as if it's also remembered. The cause seems to be, every time I collapse it and the file is externally changed, it uncollapses!

I did a clean test. Created a file externally with such region and some additional methods, and when I open it for the first time in IDEA the region is collapsed while other methods are collapsible but not collapsed. When I uncollapse it, close, and reopen it, it's still uncollapsed. `workspace.xml` stays unmodified so that's not where it's remembered. I wonder If I misconfigured anything or if this is a 'feature'? How can I work around this so auto-folding regions will always be collapsed when opening a file? (and preferably also when a file is externally modified)

I have `Settings`→`Editor`→`General`→`Code Folding`→`Collapse by default:`→`Custom folding regions` checked.

2

Please sign in to leave a comment.