bugGNU nano - Bugs: bug #46980, pressing Alt+6 should not scroll...

 
 

bug #46980: pressing Alt+6 should not scroll the screen

Submitted by:  Benno Schulenberg <bens>
Submitted on:  Tue 26 Jan 2016 09:39:49 AM UTC  
 
Severity: 3 - NormalStatus: Fixed
Assigned to: Benno Schulenberg <bens>Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Tue 23 Feb 2016 12:09:12 PM UTC, comment #3:

Fixed in SVN, r5671, with an improved patch: only restore the cursor position when the mark was set.

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Thu 18 Feb 2016 08:23:50 AM UTC, comment #2:

Same patch as already posted on the mailing list.

(file #36375)

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Sat 30 Jan 2016 03:05:31 PM UTC, comment #1:

When nothing is marked, the result of Alt+6 is to copy the current line to the cutbuffer and move the cursor to the beginning of the next line. When a region is marked, Alt+6 copies this region to the cutfbuffer and puts the cursor at the end of the previously marked region (also when the region was marked backwards, which I find very odd).

Since, when a marked region is copied with Alt+6, it is not possible to /add/ stuff to this copied region, there is no point in moving the cursor one line down nor anywhere else. So when a region is marked, I think Alt+6 should not move the cursor /at all/, also not when the region is marked backwards. The principle of minimum necessary change.

So the expected behaviour of pressing Alt+6 when a region is marked is: just copy the region, undo the highlight, and for the rest leave everything as it is -- don't scroll, don't displace the cursor, don't call the fanfare, and don't segfault.

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Tue 26 Jan 2016 09:39:49 AM UTC, original submission:

To reproduce, run 'src/nano +22 README' and type:
M-A ^V M-6

Before the M-6, the cursor is on the centre line of the screen;
after the M-6, the cursor is on the bottom line.

Before version 2.4.1, an M-6 would make the screen scroll until the current line was the centre line; since 2.4.1 it scrolls until the current line is the bottom line. Neither is desirable.

Even worse, when the marking is done from bottom to top, an M-6 will actually /move/ the cursor, from the beginning of the marked region to the end. I don't know whether this is desirable.

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

 

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

Attach File(s):
   
   
Comment:
   

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by bens (Submitted the item)
  •  

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

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 27 Feb 2016 03:04:02 PM UTCbensOpen/ClosedOpen=>Closed
    Tue 23 Feb 2016 12:09:12 PM UTCbensStatusIn Progress=>Fixed
    Thu 18 Feb 2016 08:23:50 AM UTCbensAttached File-=>Added remember-and-restore-position.patch, #36375
      StatusNone=>In Progress
      Assigned toNone=>bens
    Sat 30 Jan 2016 03:05:31 PM UTCbensSummarypressing Alt+6 scrolls the screen -- it shouldn\'t=>pressing Alt+6 should not scroll the screen

    Back to the top


    Powered by Savane 3.1-cleanup1