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: Mike Scalora
Subject: Re: [Nano-devel] Comment/Uncomment feature patch
Date: Sun, 15 May 2016 09:20:57 -0600

On Sun, May 15, 2016 at 4:17 AM, Benno Schulenberg
<address@hidden> wrote:
>
> On Thu, May 12, 2016, at 13:21, Mike Scalora wrote:
>> On Wed, May 11, 2016 at 12:13 PM, Benno Schulenberg
>> <address@hidden> wrote:
>> > I thought to have found something that couldn't be undone,
>> > but I can't reproduce.  Even when I make a mess, it gets
>> > fully undone and redone.  It's looking good.
>>
>> I can make undo change only lines that are offscreen
>
> ??

Run 'src/nano +69 README'
M-3 ^^ M-\ M-4 ^^ M-u

>> but if we want to
>> put the cursor back where it was at the time of the operation, it
>> can't be helped.
>
> I don't follow what you're saying here.  Undo should not change
> something and keep it out of view (unless of course the changed
> region is so large that it doesn't fit entirely on the screen).

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

>> > Oh, and one question.  What is the advantage of having
>> > comment "#" in several syntax files over relying on the
>> > built-in default?
>>
>> Explicitness. It makes it a bit easier for someone looking in those
>> files to see where it is coming from.
>
> Okay.
>
> One other thing:
>
> +           statusbar(action == COMMENT ? _("The line is not commentable") :
> +                                       _("The line is not uncommentable"));
>
> 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.

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

> Benno

-Mike

Attachment: 0001-Add-new-comment-and-uncomment-feature-4.patch
Description: Binary data


reply via email to

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