[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: |
Wed, 07 Sep 2016 10:52:02 +0200 |
On Tue, Sep 6, 2016, at 22:12, Faissal Bensefia wrote:
> On 06/09/16 20:39, Benno Schulenberg wrote:
> > Sure, it is slow. But you should need it just a few times,
> > not for every line -- it should be possible to print the number
> > right-aligned in the available space.
> >
> I need it for every line drawn so I know how far left to shift the
> number when I draw it.
As said, it should be possible to use the right aligning abilities
of printf for that. (But leave this issue for now; I've tweaked
your patch to irk me less.)
> I've attached the patch
One thing:
- converted = display_string(fileptr->data, page_start, COLS, TRUE);
+ converted = display_string(fileptr->data, page_start, COLS + 1, TRUE);
#else
- converted = display_string(fileptr->data, page_start, COLS,
!ISSET(SOFTWRAP));
+ converted = display_string(fileptr->data, page_start, COLS + 1,
!ISSET(SOFTWRAP));
This doesn't look right -- it changes the behavior of nano also in
the case without line numbers. Are you saying that nano doesn't
behave correctly as it is now?
With "set linebumbers" in your .nanorc, run this:
'stty cols 50 && src/nano +11,44 NEWS'.
Then type <Left> <Shift+Alt+#> <Left>.
See how the word "remove" is now missing.
(Notice also that when toggling the line numbers, the screen is not
redrawn. It should.)
Attached is a tweaked patch. I've fixed some formatting mistakes,
and have removed the hex line numbering which I'm not going to
accept.
Benno
--
http://www.fastmail.com - The way an email service should be
0001-Working-toward-line-numbering.patch
Description: Text Data
- Re: [Nano-devel] Nano with Line Numbering, Faissal Bensefia, 2016/09/06
- Re: [Nano-devel] Nano with Line Numbering, Benno Schulenberg, 2016/09/06
- Re: [Nano-devel] Nano with Line Numbering, Faissal Bensefia, 2016/09/06
- Re: [Nano-devel] Nano with Line Numbering,
Benno Schulenberg <=
- Re: [Nano-devel] Nano with Line Numbering, Benno Schulenberg, 2016/09/08
- Re: [Nano-devel] Nano with Line Numbering, Faissal Bensefia, 2016/09/08
- Re: [Nano-devel] Nano with Line Numbering, Benno Schulenberg, 2016/09/09
- Re: [Nano-devel] Nano with Line Numbering, Faissal Bensefia, 2016/09/11
- Re: [Nano-devel] Nano with Line Numbering, Benno Schulenberg, 2016/09/11
- Re: [Nano-devel] Nano with Line Numbering, Faissal Bensefia, 2016/09/11
- Re: [Nano-devel] Nano with Line Numbering, Faissal Bensefia, 2016/09/11
- Re: [Nano-devel] Nano with Line Numbering, Benno Schulenberg, 2016/09/12
- Re: [Nano-devel] Nano with Line Numbering, Faissal Bensefia, 2016/09/12
- Re: [Nano-devel] Nano with Line Numbering, Benno Schulenberg, 2016/09/12