bugGNU nano - Bugs: bug #55330, when ^K does not cut anything, it...

 
 

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

bug #55330: when ^K does not cut anything, it should not add an undo item

Submitter:  Benno Schulenberg <bens>
Submitted:  Sun 30 Dec 2018 10:56:04 AM UTC
   
 
Severity:  2 - Minor Status:  Fixed
Assigned to:  bens Open/Closed:  Closed

Sat 05 Jan 2019 04:47:24 PM UTC, comment #4: 

Fixed in git, commit ce6f3209.

Benno Schulenberg <bens>
Group administrator
Sun 30 Dec 2018 01:40:09 PM UTC, comment #3: 

Second version of the patch is attached.

(file #45788)

Benno Schulenberg <bens>
Group administrator
Sun 30 Dec 2018 11:51:07 AM UTC, comment #2: 

Alt-Delete (zap) has the same issue.

Brand Huntsman <brand>
Sun 30 Dec 2018 11:31:52 AM UTC, comment #1: 

A simpler reproduction recipe is:

  src/nano --ignore

And then typing either ^K or <Ctrl+Delete> or <Shift+Ctrl+Delete>, followed by M-U.  They say they undid a cut, but nothing was actually cut.  Attached is a proposed patch.

(file #45787)

Benno Schulenberg <bens>
Group administrator
Sun 30 Dec 2018 10:56:04 AM UTC, original submission:  

To see what I mean, run:

  src/nano --ignore --nonewline +-1 NEWS

Then type ^K three times.  Nothing happens (of course), because there is nothing to cut: there is only an empty line at EOF.  Note that ^K "knows" this: it does not mark the buffer as modified.  Now type M-U.  It says "[ Undid action (text cut) ]".  (The file is still unmodified, but in this case this is because the undo brought us back to the initial, loading state of the file.)  Now type M-E.  It says "[ Redid action (text cut) ]" AND marks the buffer as modified.  This is wrong, or at least misleading.

Expected behavior: when ^K doesn't actually cut anything, it should not add an undo item.  Which would mirror ^U: when it does not actualy paste anything, it does not add an undo item.

The same goes for setting the mark, not moving the cursor, and then pressing ^K.  And for cutwordleft at top of buffer and cutwordright at end of buffer.  They should not add an undo item.

Benno Schulenberg <bens>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

 

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 (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-03-25 bens Open/ClosedOpen Closed
    2019-01-05 bens StatusIn Progress Fixed
    2018-12-30 bens Attached File- Added 0001-cutting-when-K-does-not-actually-cut-anything-do-not.patch, #45788
    2018-12-30 bens Attached File- Added 0001-cutting-when-K-does-not-actually-cut-anything-do-not.patch, #45787
        StatusNone In Progress

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code