bugGNU nano - Bugs: bug #50933, scrolling is not smooth when...

 
 

bug #50933: scrolling is not smooth when resizing the window while softwrap is on

Submitted by:  Benno Schulenberg <bens>
Submitted on:  Wed 03 May 2017 07:55:09 PM UTC  
 
Severity: 2 - MinorStatus: Fixed
Assigned to: David Lawrence Ramsey <dolorous>Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Fri 05 May 2017 10:42:11 AM UTC, comment #4:

Thanks. Pushed to git, 2b385478.

I've supplemented the fix in the subsequent commit: when toggling nohelp or morespace the cursor could also be pushed offscreen.

Benno Schulenberg <bens>
Project Administrator
Thu 04 May 2017 11:54:02 AM UTC, comment #3:

Good thinking; I wasn't sure whether the variable would be reset properly then, but it seems to be. Attached an updated version which does this.

(file #40579)

David Lawrence Ramsey <dolorous>
Project AdministratorIn charge of this item.
Thu 04 May 2017 09:01:19 AM UTC, comment #2:

Hmm... If it is the change the ensure_firstcolumn_is_aligned() call makes that makes the focusing = FALSE necessary, wouldn't it make more sense to put the focusing = FALSE in that function?

Benno Schulenberg <bens>
Project Administrator
Wed 03 May 2017 10:20:56 PM UTC, comment #1:

The problem occurs because focusing is set to TRUE, which forces the viewport to center whether or not smooth scrolling mode is on.

The attached patch should fix it. It sets focusing to FALSE in both places where ensure_firstcolumn_is_aligned() is called, so that the edit_refresh() in both places does things properly (although the first of these edit_refresh()es is indirectly called via total_refresh()).

Note that the patch also fixes an equivalent problem: the cursor can also be moved offscreen by the "resizing" done when line numbering mode is toggled on, if it's near enough to the bottom of the screen beforehand.

(file #40575)

David Lawrence Ramsey <dolorous>
Project AdministratorIn charge of this item.
Wed 03 May 2017 07:55:09 PM UTC, original submission:

To reproduce, run:

src/nano --ignore --smooth --soft +86,68 doc/faq.html

See how "2.8.1" is on the center line of the screen. Then gently resize the window, making it narrower, and see how "2.8.1" slowly sinks to the bottom of the screen, until... you suddenly lose sight of it because it has jumped to the middle line again.

But --smooth is active: nano should not scroll more than is needed to keep the cursor on the screen.

Expected behavior: when the cursor is "pushed off" the screen by resizing, things are scrolled just enough to bring the cursor back onto the bottom row of the edit window.

Benno Schulenberg <bens>
Project Administrator

 

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

Attach File(s):
   
   
Comment:
   

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by dolorous (Updated the item)
  • -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
    Fri 19 May 2017 10:11:31 AM UTCbensOpen/ClosedOpen=>Closed
    Fri 05 May 2017 10:42:11 AM UTCbensStatusIn Progress=>Fixed
    Thu 04 May 2017 11:54:02 AM UTCdolorousAttached File-=>Added 0001-display-ensure-smooth-scrolling-when-resizing-change.patch, #40579
    Thu 04 May 2017 09:01:19 AM UTCbensStatusNone=>In Progress
      Assigned toNone=>dolorous
    Wed 03 May 2017 10:20:56 PM UTCdolorousAttached File-=>Added 0001-display-ensure-smooth-scrolling-when-resizing-change.patch, #40575

    Back to the top


    Powered by Savane 3.1-cleanup1