Netbeans 7.2 introduces support for folding if/for/try… statements in PHP .
This leads to the situation that if you want to see a method and this method has many if/for/try… blocks you have to open many subfolds before the whole method is shown.
Netbeans offers two folding actions at the moment: a) open/close fold under cursor and b) open/close all folds.
I propose a third action c) 'open/close fold under cursor and all its subfolds' which should work analog to vim's zO command : it opens the fold under the cursor and all the subfolds it contains but does not affect any other folds in the same document.
Seems beneficial in case of complex fold structure; any idea for a gesture for this function ?
I've already used "ctrl" modifier - ctrl-click expands/collapses next level if more folds occupy the same line.
Doubleclick on the fold sign ?
I use 'Collapse by Default: Methods' to give me a quick outline of the class when it opens. I find it easier to scroll through the file and inspect the class interface and PHPDoc. However, collapsing other control statements, as is now happening, just creates more clicks for me with no particular benefit.
For comparison, jEdit (www.jedit.org) allows expanding all child blocks with Shift + Click on the folds. (It also allows more flexible control over indentation and parsing, adjustable per file type, and per file if necessary, would love to see this flexibility in Netbeans.)
(In reply to comment #2)
> I use 'Collapse by Default: Methods' to give me a quick outline of the class
> when it opens. I find it easier to scroll through the file and inspect the
> class interface and PHPDoc. However, collapsing other control statements, as is
> now happening, just creates more clicks for me with no particular benefit.
Note that this is not a new behaviour. PHP folding support uses 'code-block' type for both method-level and statement-level folding; the CSL fold infrastructure does not support additional types. When you switch 'fold methods', you actually affect all 'code-block' type folds, in PHP case both methods and if/else/while/... statement blocks.
First CSL should provide PHP with support to extend fold types. Then PHP should separate method/statement fold types, so they can be controlled independently.
Moving to CSL.
The enhancement contains also core folding-related request, the comments #2 and #3 describe an unrelated issue, which seems to be covered e.g. by issue #157709. Moving back :) The CSL related part is alreay tracked.
CTRL + click or CTRL + SHIFT + click would work for me. Would be even better if a user would be able to define it. Maybe a simple option like "CTRL+click (un)folds all levels recursively" (true/false).
For a keybord-only shortcut, CMD/CTRL + [+] is the actual shortcut for unfold
so CMD/CTRL + SHIFT + [+] would be nice for expand all children next to the actual position.
*** This bug has been marked as a duplicate of bug 216226 ***