bugGNU nano - Bugs: bug #61175, [Wish] doing a full justification...

 
 

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

bug #61175: [Wish] doing a full justification should not move the cursor

Submitter:  Benno Schulenberg <bens>
Submitted:  Fri 17 Sep 2021 07:39:51 AM UTC
   
 
Severity:  1 - Wish Status:  Fixed
Assigned to:  bens Open/Closed:  Closed

Thu 24 Mar 2022 05:59:14 PM UTC, comment #1: 

Fixed in git, commit 803ea0d7, by jumping back to the line number where the cursor was when M-J was pressed.  This is likely not to be the precise line where the cursor was before the justification, but in most cases it will be quite near -- good enough.

Benno Schulenberg <bens>
Group administrator
Fri 17 Sep 2021 07:39:51 AM UTC, original submission:  

When doing a full justification (M-J), the cursor is moved to the bottom of the buffer.  This serves no purpose, and needlessly causes the user to lose their current position in the file.  Also, I can imagine that the user would be quite interested in how the current part of the file would look /after/ the change: he/she would like to see the change happen.

When justifying a paragraph (^J), it makes sense to move the cursor to the end of the paragraph, so that with a series of ^Js several paragraphs can be justified in a row.  But with M-J this doesn't make sense: there is nothing further to justify.  So it would be much better to not move the cursor, to keep the current paragraph and current line centered as much as possible.  (And if the user really wants to go to the bottom of the buffer, it is just one keystroke away: Ctrl+End or M-/.)

Keeping the current line or paragraph centered might not be easy: if I'm not mistaken, justifying each paragraph results in all the linestructs getting replaced with new ones, so we can't just rejump to a linestruct.  And when many lines get rewrapped, the line numbers can change a lot too, so jumping to a line number will in general not keep us in the same spot either.  :|

Benno Schulenberg <bens>
Group administrator

 

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

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -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 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-04-29 bens Open/ClosedOpen Closed
    2022-03-24 bens StatusNone Fixed
        Assigned toNone bens

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code