Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!

Bug 188573

Summary: Code folding state should be persisted for opened files
Product: editor Reporter: David Strupl <dstrupl>
Component: Code foldingAssignee: Svata Dedic <sdedic>
Status: RESOLVED WONTFIX QA Contact: issues <issues.netbeans.org>
Priority: P3 CC: berniev, dkaspar, pavlosgr, pfelenda, umitnuri, wnjordan
Version: 6.x   
Target Milestone: TBD   
Hardware: All   
OS: All   
Whiteboard:
Issue Type: ENHANCEMENT Exception Report:
Bug Depends on: 177864    
Bug Blocks:    

Description David Strupl 2010-07-12 09:11:41 UTC
Steps:

1. Open a file in the editor
2. Collapse some folds
3. Shut down NetBeans
4. Start NetBeans
5. The stuff you have manually folded is unfolded again

IMHO the opened editor should remember the state with respect to collapsed folds. The question is whether the state should be persisted also for closed files (??).
Comment 1 David Strupl 2010-07-16 20:09:34 UTC
IntelliJ and Eclipse do NOT persist the fold state so maybe I am just crazy to request it.
Comment 2 Geertjan Wielenga 2011-10-25 19:17:41 UTC
Would be good to have an option in the Options window specifying whether you want to persist code folds across restarts.
Comment 3 Svata Dedic 2012-06-07 11:10:20 UTC
*** Bug 41232 has been marked as a duplicate of this bug. ***
Comment 4 Svata Dedic 2012-12-11 10:52:11 UTC
*** Bug 216377 has been marked as a duplicate of this bug. ***
Comment 5 Svata Dedic 2013-02-19 21:01:31 UTC
*** Bug 226145 has been marked as a duplicate of this bug. ***
Comment 6 Svata Dedic 2014-01-30 10:50:31 UTC
*** Bug 241152 has been marked as a duplicate of this bug. ***
Comment 7 Mte90 2014-08-05 19:32:40 UTC
any news about this?
Comment 8 Svata Dedic 2015-03-31 07:58:21 UTC
*** Bug 241038 has been marked as a duplicate of this bug. ***
Comment 9 nimnio 2015-04-10 23:44:27 UTC
I'd go as far to say that without this enhancement, code folding is a pretty useless feature. I'd like to collapse my accessors and equivalents, but I'm certainly not going to bother doing it every time I open a file.
Comment 10 Svata Dedic 2015-04-11 05:37:42 UTC
There are options to have certain constructions auto-collapsed, but accessors not (yet) recognized as special type of methods. Actually implementng accessor auto-collapse option is probably far easier than persistng fold states :)
Comment 11 mkotsollaris 2015-09-09 13:37:19 UTC
wow 5 years with this simple feature request and nothing.. Switching IDE is the only option I have now.
Comment 12 Svata Dedic 2015-09-09 14:01:53 UTC
(In reply to mkotsollaris from comment #11)
> wow 5 years with this simple feature request and nothing.. Switching IDE is
> the only option I have now.

Persisting code folds is not that trivial. How would you record identity of the non-default fold ? Line or position is bad: text may change as a result of e.g. VCS operation. Then we are talking about remembering some signatures, tree paths (i.e. in PHP, which allows to collapse ifs) etc. 

There are still far more important productivity features to implement in the IDE.
Comment 13 nimnio 2015-09-09 20:15:39 UTC
Thank you for the explanation, Svata. It makes sense. This is not a "simple" request.

And mkotsollaris, don't make me laugh. Persistent code folding is not a killer feature, and if it's so simple and important to you, you should implement it yourself -- the software is free, after all.
Comment 14 Martin Balin 2016-07-07 07:26:49 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss
Comment 15 Svata Dedic 2016-07-13 12:23:30 UTC
*** Bug 177864 has been marked as a duplicate of this bug. ***
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo