Product Version = NetBeans IDE 7.2 (Build 201207171143)
Operating System = Linux version 3.0.0-23-generic-pae running on i386
Java; VM; Vendor = 1.6.0_24
Runtime = OpenJDK Client VM 20.0-b12
The code folds introduced in 7.2 are a huge leap forward. Thank you!
It would be really nice to have easier/faster access to controlling them.
Opening a document with all folds closed and then drilling down from some point in the code through several levels is a bit tedious, and one (read me) tends to do that a lot. And opening ALL folds at once is not necessarily what one wants either.
I propose to add, or move, code fold controls to the code fold symbol ([+] or [-]) itself. This places the control right where you are looking at that time without having to find and dig through various general purpose menus, and simultaneously adding the ability to open or close all folds within a particular starting fold.
Add right click, context sensitive, options on the code fold symbol such that:
- If fold is open (showing [-]):
a) close current fold.
b) close current fold AND all enclosed folds.
- If fold is closed (showing[+]):
a) open current fold.
b) Open current fold AND all enclosed folds.
Currently right click is unused at the code fold symbol.
*** Bug 213218 has been marked as a duplicate of this bug. ***
Planning for 7.4.
The recursive unfold should be possibly by both mouse gestures in the outline bar, and by popup menu actions, with the option to assign keyboard shortcuts to them.
BTW - what is the scenario for "close current fold and enclosed folds" ? I understand the "expand subtree" drilldown case ... but collapse ?
CTRL SHIFT [+] is already assigned to "expand all", so the next sensible shortcut would be CTRL-SHIFT-[*] (numpad star/multiply)
Consistency: For each open option an equivalent collapse option. IMHO it's much easier if you don't have to remember whether a permutation is implemented or not.
If I close(all) a chunk of code, I know it will reopen in a clean, all nested folds closed state, not with some nested folds open and some closed from previous fiddling.
On the other hand if I just close a fold, I would reasonably expect that when I reopen it, the previous state of nested folds will be restored.
I have no opinion re keys, my brain only remembers the shortcut keys I use lots! Not being a nix guru I prefer to work visually using mouse for most things (suspect I am not alone), hence the proposal re the mouse actions on the code fold symbol on screen.
Implemented in http://hg.netbeans.org/jet-main/rev/b9627ba36fd2.
The recursive collapse/expand can be achieved when holding SHIFT and clicking on the fold sign. In addition, shortcuts CTRL-Num* (expand), CTRL-Num/ (collapse), alternatively CTRL-ALT-[+], CTRL-ALT[-]. Should be CMD-ALT-[+-] on mac.
I am curious though why the original suggestion to include a right-click based option was apparently not adopted. Many other options are available this way and without it this wonderful feature is rather hidden, unless you know to go looking for it.
Integrated into 'main-golden', will be available in build *201305021042* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
User: Svata Dedic <email@example.com>
Log: #216226: Implemented recursive expand/collapse, shortcuts added. Enabled for CSL-based editors