This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 216226 - Enhance control of code folding
Summary: Enhance control of code folding
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Code folding (show other bugs)
Version: 7.2
Hardware: PC Linux
: P3 normal (vote)
Assignee: Svata Dedic
URL:
Keywords: PLAN
: 213218 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-08-01 00:13 UTC by berniev
Modified: 2013-05-02 14:14 UTC (History)
2 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description berniev 2012-08-01 00:13:10 UTC
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

FWIW ...

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.
Comment 1 Svata Dedic 2012-12-11 10:37:39 UTC
*** Bug 213218 has been marked as a duplicate of this bug. ***
Comment 2 Svata Dedic 2012-12-11 10:38:57 UTC
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.
Comment 3 Svata Dedic 2013-04-29 14:38:07 UTC
BTW - what is the scenario for "close current fold and enclosed folds" ? I understand the "expand subtree" drilldown case ... but collapse ?
Comment 4 Svata Dedic 2013-04-29 14:56:27 UTC
CTRL SHIFT [+] is already assigned to "expand all", so the next sensible shortcut would be CTRL-SHIFT-[*] (numpad star/multiply)
Comment 5 berniev 2013-04-29 15:30:31 UTC
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.
Comment 6 Svata Dedic 2013-04-30 11:18:42 UTC
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.
Comment 7 berniev 2013-05-02 01:31:43 UTC
Fantastic!

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.
Comment 8 Quality Engineering 2013-05-02 14:14:12 UTC
Integrated into 'main-golden', will be available in build *201305021042* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/b9627ba36fd2
User: Svata Dedic <sdedic@netbeans.org>
Log: #216226: Implemented recursive expand/collapse, shortcuts added. Enabled for CSL-based editors