nano-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Global tabgives and spacestotab config option


From: Benno Schulenberg
Subject: Re: Global tabgives and spacestotab config option
Date: Fri, 4 Jun 2021 10:18:57 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

Op 01-06-2021 om 10:51 schreef Benno Schulenberg:
> Op 31-05-2021 om 18:46 schreef Peter Magnusson:
>> I think its a good idea, can nano have a spacestotab config option?
> 
> In theory a --spacestotab option would be possible, but it would be
> wildly complicated because of Undo -- nano would need to backtrack
> and change not only the typed spaces in the buffer to a tab but also
> the spaces in the undo stack, and not forget to adjust the file size.

Now I realize that this would work only for the normal typing.  For the
pasting from the outside into nano another piece of code would be needed,
as nano does bracketed pasting nowadays.

But instead of asking for a new feature in nano, you could also write
a wrapper script that replaces (after nano exits) every group of eight
leading spaces with a tab.  The script could even peek into ~/.nanorc
to see what tabsize is set to and use that to count the spaces.  When
you've written the script, please post it here.

Benno

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]