[Github-comments] [geany/geany] Folding code: more advanced commands (#2920)

Vic notifications at xxxxx
Sun Oct 10 05:59:27 UTC 2021


> Btw looks like "Toggle current fold" use that "Fold/unfold all children of a fold point" configuration too.

Right; except the Shift switch doesn't work to change the behavior of the Toggle current command.

So then your (un)fold recursive is almost the same as what I got to in C3/C4. With just one difference: to apply to descendants (= to children, recursively) only, not to parent node.
Here's why it may be better: 
when you come to a parent node:
1. if it's initially closed, your first action will probably be just to toggle it open. You wouldn't want to open it and its children recursively, as that will reveal too much infor at once. 
2. Now once you opened it, if children happen to be closed, that's fine, you can select one of them to explore (in particular with CO1/CO2 if want). If you really want to pop them all open at once, then the Unfold All descendants I suggest still does the job. 
But if all/most chilren are already opened (let alone if their descendants too), you'll want to close them (too much info at once!). So here the Fold All Descendants will come in very handy: will fold the children of children, but you'll still see curent (parent) and its children.
3. If instead the node is initially open... see 2.

(This formulation also logically agrees with what (Un)Fold All does, if imagine that the ancestor node  of all nodes in file is the file itself..)

So we have 3 existing, + 4 new suggested. 
In addition, we could also include a command to open/unfold All nodes of Ist (top) level, and another to close/fold them   - just b/c we're at it... 
Though I'm personally not convinced these fixed-level of all nodes are useful; or at least not useful beyond Ist level (b/c usually you dont' want to see too much at once, and you'll work in a local region anyway, where toggle current and/or (Un)Fold Descendants and CO1/CO2 will do a better job ).



-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/issues/2920#issuecomment-939412742
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20211009/6a3bf4a1/attachment.htm>


More information about the Github-comments mailing list