nano-devel
[Top][All Lists]
Advanced

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

Re: [Nano-devel] [PATCH] bug #48305: allow any kind of separator in "Go


From: Rishabh Dave
Subject: Re: [Nano-devel] [PATCH] bug #48305: allow any kind of separator in "Go To Line"
Date: Mon, 4 Jul 2016 17:23:47 +0530

On Sun, Jul 3, 2016 at 11:42 PM, Benno Schulenberg
<address@hidden> wrote:
> But forget all that.  Patch is too complicated.  Let's start over.
>
> You can skip whitespace with:
>
>     while (*str == ' ')
>        str++;
>
> Skipping just spaces is enough -- input from the prompt won't
> contain tabs.  (Oh, it could, if the user typed M-V <Tab>, but
> we're just trying to forgive accidental mistypings, we're not
> trying to read hieroplyphs.)  And let's forget about accepting
> /any/ character as a separator, let's just take the ones that
> are next to the comma key (m and period) and some that are
> commonly used as a separator (space, semicolon and slash).
> Try using strpbrk() -- see man 3 strpbrk.
>
> Patch should be very simple.

And strpbrk() also made it look elegant. Patch is attached.

>
>> > Also, do you ever look at the output of 'git diff"?  Because
>> > again you have trailing whitespace in your patch.  If you do
>> > use 'git diff' (don't use 'less', it will do that automatically),
>>
>> Mostly, yes. I would look specifically for them before attaching the
>> patch using nano's alt+p option.
>
> But it should be unnecessary to use Alt+P.  When you look at a
> .patch or .diff file with nano, trailing whitespace should be
> very visible: green blocks at the ends of lines.

I edited rc-file with the help of manual, now it is working well.
There are some green blocks in patch by default - source file doesn't
have them. So, they are not be bothered with, I assume; must be
introduced by git diff program.

>> > what is the output of 'git config color.diff'?  If it's not auto,
>> > then set it so with 'git config color.diff auto'.
>>
>> It gives no output.
>
> Then run this again:
>
>   git config color.diff auto
>
> and then:
>
>   git config color.diff
>
> What does it say then?

It says "auto". Did that last time after sending you mail. Sorry, I
should have informed you.

Attachment: use-strpbrk-for-separator.patch
Description: Text Data


reply via email to

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