nano-devel
[Top][All Lists]
Advanced

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

Re: [Nano-devel] RFC: line numbers?


From: Benno Schulenberg
Subject: Re: [Nano-devel] RFC: line numbers?
Date: Thu, 20 Oct 2016 12:09:47 +0200

On Thu, Oct 20, 2016, at 11:41, Faissal Bensefia wrote:
> On 19/10/16 20:00, Benno Schulenberg wrote:
> >     new feature: the ability to show line numbers before the text
> >     
> >     It can be activated with --linenumbers on the command line or with
> >     'set linenumbers' in a nanorc file, and it can be toggled with M-#.
> 
> Yeah, I've used that one for this patch (I did change the capitalisation
> though).

The lack of capitals in the first line is the proper style.

> On 19/10/16 20:40, Chris Allegretta wrote:
> > Apologies, not been in the loop until now, but I think it makes sense
> > to optimize the layout for at least 99/999 lines by default.
> 
> Done, I've made it so that it doesn't change between 9 and 10 lines but
> I've left it still changing between 99 to 100 lines

+       if (digits(openfile->filebot->lineno) + 1 != margin
+           || digits(openfile->filebot->lineno) != 2) {
+           margin = digits(openfile->filebot->lineno) >2 ?
+               digits(openfile->filebot->lineno) + 1 : 3;

That can be done much simpler by tweaking digits() itself.
See attached patch.

> > The second patch adds an option to change the color of the
> > line numbers.
> 
> I've incorporated this in the patch.

No, you shouldn't.  Keep it separate -- it is my work,
not yours.  It was just to show what will follow after
your patch.

Benno

-- 
http://www.fastmail.com - Access all of your messages and folders
                          wherever you are

Attachment: 0001-new-feature-the-ability-to-show-line-numbers-before-.patch
Description: Text Data


reply via email to

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