bugGNU nano - Bugs: bug #53376, nano sometimes tries to display...

 
 

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

bug #53376: nano sometimes tries to display something on an offscreen row

Submitter:  Benno Schulenberg <bens>
Submitted:  Sun 18 Mar 2018 12:43:40 PM UTC
   
 
Severity:  3 - Normal Status:  Fixed
Assigned to:  bens Open/Closed:  Closed

Jump to the original submission

Sun 18 Mar 2018 07:14:00 PM UTC, comment #8: 

Thanks for testing.  Fixed in git, commit 373e3b88.

(The thing with the far-out line number comes from the fact that update_softwrapped_line() assumes that the given line (fileptr/old_current) is somewhere after edittop.  But in this case it wasn't, and thus the 'while' loop at line 2765 runs on to the end of file, incrementing 'row' to the total number of lines.)

Benno Schulenberg <bens>
Group administrator
Sun 18 Mar 2018 05:12:17 PM UTC, comment #7: 

It does work, when in softwrap mode and when not in it.  (I stress-tested it with a file with an extremely long first line, and it works there too.)  As for whether the condition can be simplified, I'm not sure how to do that at the moment, but the problem does seem to be fixed regardless.

David Lawrence Ramsey <dolorous>
Group Member
Sun 18 Mar 2018 03:47:55 PM UTC, comment #6: 

(Our bug updates crossed each other.)

Please try the latest patch, from comment #4.

Benno Schulenberg <bens>
Group administrator
Sun 18 Mar 2018 03:35:33 PM UTC, comment #5: 

I've noticed that line 1742 in the news file is the next-to-last line of the file (which is important information).

I can't find the bug/patch right now, but back when I was looking at place_the_cursor() (then reset_cursor()) when adding the softwrap overhaul, I found a problem with edittop's being set to the line after filebot (which showed up only because nano was trying to update the file after it was loaded but before the buffer was in a sane state), which you thought was harmless, but may be related to this?

David Lawrence Ramsey <dolorous>
Group Member
Sun 18 Mar 2018 03:29:18 PM UTC, comment #4: 

Updated patch should work also for the softwrap case.  If you can find a simpler condition, please let me know.

(file #43589)

Benno Schulenberg <bens>
Group administrator
Sun 18 Mar 2018 03:04:43 PM UTC, comment #3: 

Hrm.  Patch doesn't work for the softwrap case.

Benno Schulenberg <bens>
Group administrator
Sun 18 Mar 2018 02:58:06 PM UTC, comment #2: 

Swapping the order of scrolling and moving the cursor appears to fix it.  See attached patch.  If the cursor is on the first or last row of the edit window, and scrolling would push it offscreen, then first move the cursor and then scroll.

(file #43588)

Benno Schulenberg <bens>
Group administrator
Sun 18 Mar 2018 01:51:07 PM UTC, comment #1: 

The offending commit is a850bb25 (which fixes bug #51821).

Should we just remove the warnings?  Or should we catch and avoid these cases at an earlier stage?

Whe using softwrap, the warning becomes puzzling.  Run:

  src/nano --softwrap +1 NEWS

Then type: <Down>  M-A  <Up>  M-=

Result: [ Badness: tried to display a chunk on row 1742 -- please report a bug ]

Why does it try to display a chunk so far away from the head of the file?

Benno Schulenberg <bens>
Group administrator
Sun 18 Mar 2018 12:43:40 PM UTC, original submission:  

To reproduce, run:

  src/nano +1 NEWS

and type: <Down>  M-A  <Up>  M-=

Result: [ Badness: tried to display a line on row -1 -- please report a bug ]

Bug exists since nano-2.8.7.

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 dolorous (Posted a comment)
  • -email is unavailable- added by bens
  • -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 9 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-03-30 bens Open/ClosedOpen Closed
    2018-03-18 bens StatusIn Progress Fixed
    2018-03-18 bens Assigned toNone bens
    2018-03-18 dolorous Assigned tobens None
    2018-03-18 bens Attached File- Added 0001-scrolling-first-move-the-cursor-before-pushing-curre.patch, #43589
        Assigned toNone bens
    2018-03-18 bens Attached File- Added move-the-cursor-before-scrolling-current-offscreen.patch, #43588
        StatusNone In Progress
    2018-03-18 bens Carbon-Copy- Added dolorous

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code