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 251121 - Folding selection
Summary: Folding selection
Status: NEW
Alias: None
Product: editor
Classification: Unclassified
Component: Code folding (show other bugs)
Version: 8.1
Hardware: All All
: P3 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-12 08:32 UTC by iii
Modified: 2015-04-07 08:51 UTC (History)
0 users

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 iii 2015-03-12 08:32:04 UTC
It would be great to have the ability to fold not just code blocks but everything in selection.
Comment 1 Svata Dedic 2015-03-31 07:29:33 UTC
Do you mean an arbitrary portion of text, regardless of original structure (i.e. fold may start before if-code-block and end within the block) ? What is the use-case for such feature - please elaborate.
Comment 2 iii 2015-04-01 08:23:34 UTC
Sorry, now I see I was ambiguous. Let me specify: not an arbitrary portions, but a several code blocks at once. Currently one have to fold them one by one, if there are many code blocks of the same level.
Comment 3 Svata Dedic 2015-04-01 08:42:43 UTC
OK, this seems trivial. Let's say the the action would fold all foldable ranges which are at least partially selected (so you don't have to make precise selections) ?
Comment 4 iii 2015-04-03 07:08:23 UTC
I can't say for all, but for me it would be more understandable if folding only worked for fully selected blocks. And they were folded into one folding point, not into each own.
Comment 5 Svata Dedic 2015-04-07 07:56:14 UTC
(In reply to iii from comment #4)
> I can't say for all, but for me it would be more understandable if folding
> only worked for fully selected blocks. And they were folded into one folding
> point, not into each own.

Folding into one fold is rather peculiar: folds (so far) do not have any firm identity, so positions remain the only "handle" for the grouped folds - I think the function would be rather fragile - easily broken by various edits.

See issue #239801 for a possible alternative feature - especially if the selected folds should always act as a group
Comment 6 iii 2015-04-07 08:51:21 UTC
What do you mean broken? Fold will be expanded?
About issue #239801: I don't think that the vendor specific IDE hints is the right solution, but I like the idea of having default state for the folds. Ideally I would like to leave the task of remembering fold's state among restarts or file open/close events to the IDE (IntelliJ does that).