nano-devel
[Top][All Lists]
Advanced

[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: Sun, 15 May 2016 20:52:57 +0200

On Sun, May 15, 2016, at 17:20, Mike Scalora wrote:
> Run 'src/nano +69 README'
> M-3 ^^ M-\ M-4 ^^ M-u

Wow.  Inventive.

> The changed region is far from the cursor position at the time of the
> operation. It's an edge case for sure.

Yeah.  I cannot imagine someone doing an M-4 when there is
no comment in sight.  Or if, then tentatively, just to see
if there is any commented line in the marked region -- the
silence on the statusbar will tell them that there was, and
the undo message will tell them that it was undone.

> > How can a line not be commentable?  Isn't this case already handled
> > by the 'if (strlen(comment_seq) == 0)' above?  Or is this just for
> > the magic line?
> 
> Yes, the magic line case is the only one I know of.

I think I would prefer a different solution: just comment
the magic line and add a new one.

> > Testing...  Run 'src/nano --ignore --nonew +99 README', then type:
> > M-3  M-U
> >
> > Segmentation fault.
> 
> Since fsfromline() can return null, I changed the code to always check now.

Hmm.  But why does it return null?  I think you should only
call fsfromline() with a line number that ought to exist.
Because: ready to be pushed sits a commit that makes fsfromline()
produce always a mayday message when it can't find the line.

Somehow it seems that the relevant group should not have
been created, if it refers to a line that does not exist.

Benno

-- 
http://www.fastmail.com - The professional email service




reply via email to

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