Re: line folding

Benno Schulenberg <[email protected]>
Newsgroups gmane.editors.nano.devel
Message-ID <[email protected]>
Op 17-10-2024 om 13:44 schreef rexy712:
> If no lines are selected and the current line is folded, it unfolds. Otherwise, 
> if no lines are selected, it will search downward for either the next folded 
> line or the next open bracket, whichever occurs first. If it finds a bracket, it 
> searches for the matching closing bracket, then it folds all lines between them. 
> If it finds a folded line, it unfolds that segment. If neither is found, it 
> prints an error that no automatic fold could be performed.

Maybe all this can be simplified to:

• If lines are selected, fold those lines or folds into one fold;
• otherwise, if the current line is a fold, unfold it;
• otherwise, jump to the next fold, if any.

Then, when the user wants to treat functions specially, they could
define a custom keystroke for that (or simply rebind M-[):

   bind Sh-M-F "{search}{{}{enter}{mark}{findbracket}{fold}" main

If they want the brackets to not be folded, they can add a {down}
and an {up} before and after {findbracket}.


Benno
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.