bugGNU nano - Bugs: bug #56189, the prepending behavior can be...

 
 

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

bug #56189: the prepending behavior can be improved

Submitter:  Benno Schulenberg <bens>
Submitted:  Sun 21 Apr 2019 05:33:28 PM UTC
   
 
Severity:  2 - Minor Status:  Fixed
Assigned to:  bens Open/Closed:  Closed

Tue 23 Apr 2019 08:26:39 AM UTC, comment #2: 

An improved patch has been pushed to master, commit 34d22d3f.

Benno Schulenberg <bens>
Group administrator
Sun 21 Apr 2019 05:49:11 PM UTC, comment #1: 

Attached is a patch that improves the prepending behavior.

Now, there is a remote possibility that, after the user has caused a line to spill over onto a new one, this line is deleted (or cut and pasted somewhere else), and thus the memory associated with that line is freed, and when this memory gets reused for a different line, and this line happens to be right after a line that the user now causes to spill over... then this spillover would be prepended to this different line even though this line was not created by the automatic hard-wrapping routine.

First, I think that the chances of a linestruct getting reused are exceedingly small.  Second, when automatic hardwrapping is being used, the user most likely has justified paragraphs, which means that either 1) the reused linestruct is a line that already occupies nearly the whole width and prepending a word is not possible, so a new line would be created anyway, or 2) the reused linestruct uses less than the full width (it is the end of a paragraph) and prepending spilt-over stuff from the preceding line would be the right thing to do.  The chance that this prepending is not what the user wants seems small.  So... all in all, I think the improved persistence is worth the little risk of  a strange surprise.

(file #46808)

Benno Schulenberg <bens>
Group administrator
Sun 21 Apr 2019 05:33:28 PM UTC, original submission:  

To see what I mean, run:

  src/nano --ignore --break --fill=69 --auto +9,56 README

Then type: one <Space> two <Space> three <Space>

The "three" has spilled onto the next line, before "does not use".  Now press <Up> and type: more <Space> extra <Space> words <Space>

There is no reason for "suite one two" to be pushed onto a line by themselves, they could very well have been prepended to the "three does not use".  If this were the end of a paragraph, the user would not need to do any justifying if the automatic hard-wrap had continued to spill over onto the same line.

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 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
    2019-04-25 bens Open/ClosedOpen Closed
    2019-04-23 bens StatusIn Progress Fixed
    2019-04-21 bens Attached File- Added 0001-wrapping-improve-the-persistence-of-the-prepending-b.patch, #46808

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code