nano-devel
[Top][All Lists]
Advanced

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

Re: [Nano-devel] Nano with Line Numbering


From: Benno Schulenberg
Subject: Re: [Nano-devel] Nano with Line Numbering
Date: Sun, 28 Aug 2016 10:24:58 +0200

On Fri, Aug 26, 2016, at 20:27, Faissal Bensefia wrote:
> I've done everything except:
> Remove the bold, because something needs to differentiate the line
> numbering from the text.

Even when the user wouldn't know that 'set linenumbers' is in
effect (which is unlikely, because it won't be the default),
the vertical alignment, and the fact that the cursor cannot go
there, will be indication enough that those things at the head
of each line are line numbers.

> Add the toggle, because I have no idea which key to use, M-L, M-N, M-D,
> M-H and M-I are all taken.

There are still several free: M-1, M-2, M-4, M-5... M-!, address@hidden
I suggest you use M-#.  It's not easy to type, but it won't be
used often, and it is kind of mnemonic.

> configure.ac: Because I honestly have no idea how to use automake yet
> and it's probably better if someone who has experience does that.

It should be fairly easy to copy and the adapt the item for
--disable-help.
 
> I've attached the new diff.

(As said in the previous mail, it still contains revision.h.)

Hm.  You changed the behavior with long lines.  Without your
patch, when the last character of a long lines fits onscreen,
no $ is printed.  With your patch, that last character is
replaced with a $.  Not right.  Also, when a long line is
horizontally scrolled, the leading $ is printed in the margin
instead of in the position of the first character.  That is
kind of nice, of course, but it diverges from nano's current
behavior.  Worse, when linenumbers are turned off, the $ at
the head of a scrolled line is not printed at all.

When linenumbers are turned on, run the following command:

    stty cols 44 && src/nano --soft +5,88 README.GIT

See how the A of NANO is missing on the first line.  Also see
how some lines at the bottom are missing.  Also see how the
line numbers don't match: the line of ===, for example, should
be marked as line 2, not 3.  When softwrap is in effect, having
line numbers would be quite useful for distinguishing wrapped
parts of lines (no line number) from the starts of real lines.

Now type: xxx.  See how the exes appear on the line /above/
the cursor.  Now type <Up>.  See how line "8" disappears.

About the patch itself.  There is a shorter way to implement
the function intlen().  See the function digits() here:

    git log -p -1 f111c0 src/utils.c

Benno

-- 
http://www.fastmail.com - Faster than the air-speed velocity of an
                          unladen european swallow




reply via email to

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