bugGNU nano - Bugs: bug #49088, with softwrap, a Ctrl+Right...

 
 

bug #49088: with softwrap, a Ctrl+Right sometimes scrolls the wrong way

Submitted by:  Benno Schulenberg <bens>
Submitted on:  Wed 14 Sep 2016 11:10:05 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.

 

(Jump to the original submission Jump to the original submission)

Fri 28 Oct 2016 06:01:21 PM UTC, comment #10:

Closing, because it's an unreleased bug.

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Tue 20 Sep 2016 10:48:44 AM UTC, comment #9:

*"to verify the problem is fixed"

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Tue 20 Sep 2016 10:47:48 AM UTC, comment #8:

Fixed in git, 598e0af.

The fix also improves the centering behavior of nano at startup (when softwrap is used). So to very the problem is fixed, run 'stty cols 120 && stty rows 20 && src/nano --ignore --smooth --soft +191,888 doc/faq.html' and type <M--> followed by three time <Down>, and then <Right> or <Ctrl+Right>, and see how the partial line is scrolled fully into view.

(In the beginning I shouldn't have said that bug #47710 was worsened. It wasn't. I was confused with bug #49086.)

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Thu 15 Sep 2016 08:03:31 PM UTC, comment #7:

The patch is working so far, but I found bugs 49099 and 49100 while testing with it (both bugs occur without it, though).

David Lawrence Ramsey <dolorous>
Project Administrator
Thu 15 Sep 2016 10:20:26 AM UTC, comment #6:

Attached is what I am testing now -- a slightky refined version of the previous patch.

(file #38515)

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Thu 15 Sep 2016 08:36:23 AM UTC, comment #5:

Here is a provisional patch. First it reduces the amount to retreat with the extra number of lines that current takes up. And second, if the last retreating step overshot the target, step one line forward again.

It will probably need some refinements, but it fixes both bugs for me.

(file #38513)

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Thu 15 Sep 2016 03:32:12 AM UTC, comment #4:

Okay. I apparently don't understand this as well as I thought (and I'm a bit rusty on the older code, so thanks for the explanation). If I can figure anything out, I'll let you know.

David Lawrence Ramsey <dolorous>
Project Administrator
Wed 14 Sep 2016 06:52:34 PM UTC, comment #3:

The value of current_y is only used when edit_update() is called with STATIONARY -- and edit_redraw() calls edit_update() only with either CENTERING or FLOWING, so there is no need to keep current_y in sync in those cases. (It will be re-evaluated as soon as the movement is completed and we return to the chief loop in main().)

Forcing the Ctrl+Right behavior back to what it was before fc9c7b4 doesn't help much. A solution should fix both this bug /and/ bug #47710.

(By the way: better use 'git diff' to produce patches: it shows the function names in which each of the hunks occur, which is often helpful.)

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Wed 14 Sep 2016 03:26:51 PM UTC, comment #2:

Never mind the first version of the patch; the current_y updates should avoid problems with inconsistent scrolling, but the scrolling problem is still there. The second version is really a brute-force attempt to figure out what's wrong, by forcing a stationary edit_update() when in softwrap mode: it fixes the reverse scrolling problem, but if you continue to press Ctrl-Right after the first time until you go off the bottom of the edit window, you'll end up with a version of bug 47710 again.

(file #38508)

David Lawrence Ramsey <dolorous>
Project Administrator
Wed 14 Sep 2016 01:19:25 PM UTC, comment #1:

I've tested that (although with doc/faq.html, since ~/Repositories/NANO/doc/faq.html is not on my system), and the attached patch experimentally seems to fix it.

The problem is that smooth scrolling (STATIONARY scrolling in current code) depends on current_y's being kept up to date. If current is moved without current_y's being adjusted accordingly, edit_redraw() gets confused as to which direction and how much to scroll.

The current moving code throughout move.c keeps current_y in sync properly, except in do_prev_word() and do_next_word() (and do_prev_block() and do_next_block(), which have no bugs reported against them, but which are also much newer than do_prev_word() and do_next_word()). The attached patch, against git 97f6ae5, fixes this in those places.

(file #38503)

David Lawrence Ramsey <dolorous>
Project Administrator
Wed 14 Sep 2016 11:10:05 AM UTC, original submission:

To reproduce, run 'stty cols 120 && stty rows 20 && src/nano --ignore --smooth --soft +191,888 ~/Repositories/NANO/doc/faq.html', type <Down> twice, the press Ctrl+Right. See how the screen scrolls a line down instead of up.

This behavior is caused by recent commit fc9c7b4, which fixes bug #42189. But this fix worsens the behavior seen in bug #47710.

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
file #38509:  nano-97f6ae5-redrawfixes2.patch added by dolorous (2KiB - text/x-patch - Updated to fix tiny mode compilation.)

 

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 11 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 28 Oct 2016 06:01:21 PM UTCbensOpen/ClosedOpen=>Closed
    Tue 20 Sep 2016 10:47:48 AM UTCbensStatusIn Progress=>Fixed
    Thu 15 Sep 2016 10:20:26 AM UTCbensAttached File-=>Added 0001-softwrap-scroll-the-current-line-fully-into-view-whe.patch, #38515
      Assigned toNone=>bens
    Thu 15 Sep 2016 08:36:23 AM UTCbensAttached File-=>Added dont-backup-edittop-too-far.patch, #38513
      StatusNone=>In Progress
    Wed 14 Sep 2016 03:33:18 PM UTCdolorousAttached File-=>Added nano-97f6ae5-redrawfixes2.patch, #38509
    Wed 14 Sep 2016 03:33:07 PM UTCdolorousAttached File#38508=>Removed
    Wed 14 Sep 2016 03:26:57 PM UTCdolorousAttached File#38503=>Removed
    Wed 14 Sep 2016 03:26:51 PM UTCdolorousAttached File-=>Added nano-97f6ae5-redrawfixes2.patch, #38508
    Wed 14 Sep 2016 01:19:25 PM UTCdolorousAttached File-=>Added nano-97f6ae5-redrawfixes.patch, #38503

    Back to the top


    Powered by Savane 3.1-cleanup1