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: Faissal Bensefia
Subject: Re: [Nano-devel] Nano with Line Numbering
Date: Tue, 06 Sep 2016 12:53:42 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0


On 28/08/16 09:24, Benno Schulenberg wrote:
> 
> 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.
> 
Done, I used M-! for hex line numbering and M-# for normal line numbering.

>> 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.
>  
Done.

>> 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.
> 
Should all be fixed.

> 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
> 
That method is slow, see:
http://stackoverflow.com/a/3069580/5269447

I've attached the diffs with git format-patch like you asked.
~Faissal Bensefia

Attachment: 0001-Added-line-numbering.patch
Description: Text Data

Attachment: 0002-Bugfix-for-sudden-size-increase-causing-refresh.patch
Description: Text Data

Attachment: 0003-Cleared-revision.h.patch
Description: Text Data

Attachment: 0004-Organised-line-number-related-man-page-stuff-by-alph.patch
Description: Text Data

Attachment: 0005-Removed-old-comment.patch
Description: Text Data

Attachment: 0006-Fixed-highlighting-bug.patch
Description: Text Data

Attachment: 0007-Fixes-page-wrap-bug.patch
Description: Text Data

Attachment: 0008-Code-formatting.patch
Description: Text Data

Attachment: 0009-Revision.h.patch
Description: Text Data

Attachment: 0010-Highlighting-bugfix.patch
Description: Text Data

Attachment: 0011-Code-formatting.patch
Description: Text Data

Attachment: 0012-Formatting.patch
Description: Text Data

Attachment: 0013-Revision.h-hopefully-once-and-for-all.patch
Description: Text Data

Attachment: 0014-Bugfix-for-line-numbers-being-incorrect-when-wrapped.patch
Description: Text Data

Attachment: 0015-Bugfix-for-last-character-not-showing-when-a-page-is.patch
Description: Text Data

Attachment: 0016-Fixes-incorrect-hardwrap-behaviour.patch
Description: Text Data

Attachment: 0017-Fixes-wrap-missing-letters-sometimes.patch
Description: Text Data

Attachment: 0018-Made-line-numbering-toggleable.patch
Description: Text Data

Attachment: 0019-Made-line-number-toggling-only-work-when-compiled-wi.patch
Description: Text Data

Attachment: 0020-Can-now-be-compiled-without-linenumber-support.patch
Description: Text Data


reply via email to

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