bugGNU nano - Bugs: bug #65604, "Span has underflowed"...

 
 

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

bug #65604: "Span has underflowed" error when using --breaklonglines and --softwrap

Submitter:  correctmost <correctmost>
Submitted:  Wed 17 Apr 2024 01:22:42 AM UTC
   
 
Severity:  3 - Normal Status:  Fixed
Assigned to:  bens Open/Closed:  Open

Wed 17 Apr 2024 03:32:11 PM UTC, comment #2: 

Fixed in git, commit 7b07e1ee, by advancing 'edittop' when that line gets hard-wrapped while part of it is scrolled off the top of the screen.

The solution is not ideal, as it pushes 'edittop' just one chunk further also when several chunks were scrolled offscreen.  But... it's better than what it was, and certainly better what version 2.8.5 and earlier did (messing up the display and complaining about badness).

The solution could be made perfect by computing the offscreen chunks before the do_enter():

size_t offset = chunk_for(openfile->firstcolumn, line);

and then going forward that many chunks after the do_enter().  But... such a seldom occurrence is not worth the code.  Also: it's kind of nice that one gets to see the whole newly created line: it shows better what has happened.

Benno Schulenberg <bens>
Group administrator
Wed 17 Apr 2024 10:07:21 AM UTC, comment #1: 

Thanks for finding this!  And reporting it.

The bug exists since version 2.8.6, commit e375995d: "add new functions for chunks of varying width".  Apparently one of those functions is not equivalent to the simpler computations that they replaced.

Before that commit, typing "b" would keep line 1 above the screen and would just pull in a's from its tail to create "a a a a b" on line 2 at the top of the viewport.  But since that commit somehow 'edittop' gets pushed back and line 1 does not get displayed.  :/

Benno Schulenberg <bens>
Group administrator
Wed 17 Apr 2024 01:22:42 AM UTC, original submission:  

File set-up for 'underflow.txt':

for col in $(seq 40); do
  echo -n "a ";
done > underflow.txt


Steps to reproduce:
1 - Run `src/nano --ignore --break --soft underflow.txt`
2 - Alt + down
3 - Type b
--> You should receive a "Span has underflowed" error


Version: c02aec557c752a98929193db4ea2a236b7c8f25a

correctmost <correctmost>

 

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

    Date Changed by Updated Field Previous Value => Replaced by
    2024-04-17 bens StatusNone Fixed
    2024-04-17 bens Assigned toNone bens

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code