nano-devel
[Top][All Lists]
Advanced

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

[Nano-devel] a proposed slight change in behaviour


From: Benno Schulenberg
Subject: [Nano-devel] a proposed slight change in behaviour
Date: Sat, 14 Jun 2014 16:34:06 +0200

Hi Mark and Chris,

On Fri, Jun 13, 2014, at 19:28, Mark Majeres wrote:
> The attached patch should move the cursor to the location it was in
> when the cut command was originally issued.

Yes.  That works nicely.  Thanks!
It went, modified, into SVN, in r4966.

However, while testing it, I came across a segfault (with current
SVN, but the issue also occurs with your patch unapplied).

Run  'src/nano +12,34 ChangeLog'  and type:
<M-A>  <ArrowDown>  <^K>  <^K>  <M-U>  <M-U>

Segmentation fault.

It seems that nano sees the two ^Ks as contiguous, but makes
some mistake in putting them into a single undo item.

To me it is clear that it should treat the two ^Ks as separate
and different.  The first cuts a marked section, the second a
whole line.  The two don't fit together.  For example, try this:

'src/nano +12,23 ChangeLog'  and type:
<M-A>  <^Space>  <^Space>  <^Space>  <^K>  <^K>  <^U>

Ow!  That is unexpected.  The line now reads:
"as holding only         Meta the same Control."
instead of what I would have expected:
"         Meta the same Control."

Chris?  What does Pico do in this case?  And if it is exactly
the same as Nano currently, do you agree that it is wrong?

I would like to propose the attached very simple patch:
reset the cutbuffer whenever a ^K resets the mark.
Would this slight change in behaviour be okay?


BTW, Mark, after an undo, the 'placewewant' isn't updated.
With attached patch applied, try this:

'src/nano +12,23 ChangeLog'  and type:
<M-A>  <^Space>  <^Space>  <^Space>  <^K>  <M-U>  <Up>
Instead of going from "Control" to "Do", the cursor goes to
"(get_shortcut)".

Benno

-- 
http://www.fastmail.fm - Or how I learned to stop worrying and
                          love email again

Attachment: reset-the-cutbuffer.patch
Description: Text Data


reply via email to

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