bugGNU nano - Bugs: bug #56261, moving the cursor between zaps...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #56261: moving the cursor between zaps does not create a new undo item

Submitted by:  Benno Schulenberg <bens>
Submitted on:  Fri 03 May 2019 07:48:24 AM UTC  
 
Severity:  3 - Normal Status:  Fixed
Assigned to:  Benno Schulenberg <bens> Open/Closed:  Closed

( Jump to the original submission)

Sat 04 May 2019 09:38:28 AM UTC, comment #8: 

Thanks for checking.  The fix for the first manifestation has been pushed to master, commit edf6995b.

You're right that the second manifestation was caused by commit 2b9dd6c5 from a week ago, and the commit message on a962bcec wrongly says it existed since 3.2.  Sorry about that.

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Sat 04 May 2019 08:15:48 AM UTC, comment #7: 

I don't see any problems with the first and third patches. The second patch (a962bcec) incorrectly says it existed since 3.2 but was actually caused by 2b9dd6c57486d1fc90ab2cbf305cce2bcac8c519 (after 4.2).

Brand Huntsman <brand>
Fri 03 May 2019 03:48:36 PM UTC, comment #6: 

Slightly improved patch is attached.  Setting 'keep_cutbuffer' to FALSE in the zap function is not needed: it is pointless because the zap function never clears the real cutbuffer -- that is its whole reason of existence.

(file #46862)

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Fri 03 May 2019 12:14:22 PM UTC, comment #5: 

Brand, can you have a look at the patch in the previous comment, to see whether there is anything obviously wrong with it?

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Fri 03 May 2019 11:30:00 AM UTC, comment #4: 

Attached tentative patch fixes the first manifestation for me.

(file #46861)

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Fri 03 May 2019 11:03:02 AM UTC, comment #3: 

The second manifestation is fixed by commit a962bcec,
the third manifestation by commit b50d5758.

Those were easy.  The first manifestation will be harder to fix.

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Fri 03 May 2019 10:40:41 AM UTC, comment #2: 

There is a third manifestation too.  Run 'src/nano --ignore README' and then type:

<Alt+Del> <Alt+Del> <Alt+Del> M-A ^E <Alt+Del> M-U

The two disjoint zapping actions are undone in one step.

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Fri 03 May 2019 08:45:45 AM UTC, comment #1: 

The bug can even mess things up.  Run 'src/nano --ignore README' and type: <Alt+Del> M-6 <Up> <Alt+Del> M-U M-U

After the first M-U, nano says the file is unmodified, but the title line of the README has not been restored.

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Fri 03 May 2019 07:48:24 AM UTC, original submission:  

To reproduce, run 'src/nano --ignore README', and type:
<Alt+Del> <Down> <Up> <Alt+Del> M-U

See that the M-U puts back both zapped lines.

Now do the same but with cuts instead of zaps:
^K <Down> <Up> ^K M-U M-U

It requires two Undos to undo the two separate cuts.

Expected behavior: only zaps that are fully contiguous (both linewise and in keystrokes) should form a single undo item.  Disjoint zaps should form separate undo items, just like for ^K.

Buglet exists since zapping was introduced in version 3.2

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.

 

Attached Files
file #46861:  tentative.patch added by bens (2KiB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by brand (Posted a comment)
  • -email is unavailable- added by bens
  • -email is unavailable- added by bens (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-06-19 bens Open/ClosedOpen => Closed
    2019-05-04 bens StatusIn Progress => Fixed
    2019-05-03 bens Attached File- => Added 0001-zapping-use-the-keep_cutbuffer-logic-to-keep-undo-it.patch, #46862
    2019-05-03 bens Carbon-Copy- => Added brand
    2019-05-03 bens Attached File- => Added tentative.patch, #46861
        StatusNone => In Progress
    2019-05-03 bens Severity2 - Minor => 3 - Normal

    Back to the top


    Powered by Savane 3.5