Re: line folding

Seb <[email protected]>
Newsgroups gmane.editors.nano.devel
Message-ID <[email protected]>
Hi Benno,


>> * I select some lines of text with Shift+Arrow key.
>> 
>> * I then press M-[ to visually replace the selected (complete) lines by a
>>    single line which may for instance look something like
>>      ====> (folded lines 237 to 274) <====
>> 
>> * To unfold the lines, I place the cursor on the line above and press M-[.
>
> Right -- when a region is selected, or when the cursor is on a folded 
> part, it is quite obvious what M-[ should do.  But what should M-[ do by 
> default, when nothing is selected and the cursor is on a normal line?

Perhaps the same thing as Alt+PageUp/Down does for anchors?

If nothing is selected...

* ...and no group of lines has been folded, display the message...
 	[ There are no folded lines; to fold lines, first select them ]

* ...and if lines have been folded, go to the next group of folded lines?

> Having no experience with line folding, I would expect M-[ to do some 
> default folding action, for example: from the current line until the 
> next blank line, or: when the cursor is somewhere in a block (delimited 
> by blank lines), to fold that block...

I'm afraid that might be terrifying for some users, watching their lines 
"disappear" because they've pressed the wrong key. Perhaps it would be one
step too far in the "power user" direction.

>> (As an aside: why doesn't Shift+PageUp/Down select lines too (Nano 7.2)?)
> That's because you're using urxvt and urxvt produces strange, 
> non-conforming escape sequences for modified movement keys.  Add the 
> following two lines to your ~/.Xresources file, restart, and the 
> mentioned keystrokes should work:
>  URxvt.keysym.S-Page_Up: \033[5;2~
>  URxvt.keysym.S-Page_Down: \033[6;2~

Thanks! But I'm afraid this time it didn't work. Shift+PageUp shows me the 
lines that the terminal displayed before I opened Nano.


Sébastien.
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.