nano-devel
[Top][All Lists]
Advanced

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

Re: [Nano-devel] [PATCH] bug #48501: [Request] add the ability to paste


From: Rishabh Dave
Subject: Re: [Nano-devel] [PATCH] bug #48501: [Request] add the ability to paste at the prompt
Date: Sun, 23 Jul 2017 22:20:22 +0530

> Anyway, testing the patch, I first notice that pasting only works at
> the ^W prompt, not at M-R nor ^R nor ^O nor ^R ^T ^W...  It should
> work at all prompts.

Done. But should we display the shortcut at all prompt menus? Usually,
it is obvious for GUI programs that paste/uncut works at prompts.So, I
haven't done that. Besides, prompt menus like that Where Is already
have plenty options to display.

> Further, try this:
>
>     src/nano +7,20  README
>
> Then type: Shift+Ctrl+Left, M-6, ^W xxxx ^U
> Note how the cursor is on the "w" of "wonderfully", while it should be
> at the end of the word, just as when you would have typed the word.
>

I did write some code for this but looks like I missed it somewhere
during finalizing the patch. Added it back in this one.

> ==7602== LEAK SUMMARY:
> ==7602==    definitely lost: 5 bytes in 1 blocks
>
> That is for the four exes plus one: the old answer, which wasn't freed.
>

Fixed.

> When you're adjusting the patch, maybe be more creative with the names
> too.  Maybe rename 'new_answer' to 'fusion'.

Done.

> And I see that
> 'strlen(cutbuffer->data)' occurs three times; better assign that to
> an intermediate variable, calling it 'pastelen' -- not for performance
> but for clarity.  And it won't cost any extra lines because it will
> allow you to unwrap at least one of the other lines.

Done.

> And please drop
> the DEBUG stuff,

Done. But may I ask why? I find it useful.

> and make the comment precede the block of three strcpys
> and describe what those three statements together do: concatenate the
> head of the current answer, the first line of the cutbuffer, plus the
> tail of the current answer.
>

Done.

Attached patch is signed and but the commit message it very short
(infact, redundant). Should I describe anything more?

Attachment: 0001-new-feature-enable-uncut-at-all-prompts.patch
Description: Text Data


reply via email to

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