[Top][All Lists]

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

Re: [Nano-devel] Comment/Uncomment feature patch

From: Benno Schulenberg
Subject: Re: [Nano-devel] Comment/Uncomment feature patch
Date: Fri, 22 Apr 2016 21:40:10 +0200

On Wed, Apr 20, 2016, at 14:36, Mike Scalora wrote:
> It is not clear to me what the desired behaviour is for indent when there
> are existing partial indents, mixed spaces and tabs on lines being
> indented.

That wasn't clear to me either, as I've never used the feature.  But
now that I'm trying it, I think any partial indent (which necessarily
consists of spaces) should simply be maintained, untouched.  And when
multiple lines are selected (marked) they should only be unindented
when /all/ of the lines in the selection can be unindented by a full
tab -- it shouldn't destroy the relative indentation.

So instead of adding a tab after the spaces (when a partial indent
exists), it should add a tab before those spaces.

> It is curious to me that nano's own source is formatted with 8 char tab and
> uses 4 char indent but the indent feature appears to use tab width as the
> indent width.

Yes, it is awkward, historical.  I will correct that one of these days,
changing indentation to use only tabs -- but then, afterward, will be
considering tabs to be four spaces wide, for judging the line length,
to stay in general within 80 characters.

> Am I reading it wrong? Was that a compromise that should be
> addressed if/when I dig into indent/undo?

No.  Undo would be agnostic of what kind of tabbing or spacing is used,
it would simply restore the data of the lines that were changed during
the indentation/unindentation.


-- - Does exactly what it says on the tin

reply via email to

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