bugGNU nano - Bugs: bug #55759, a zero-width character after a...

 
 

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

bug #55759: a zero-width character after a double-width one can push stuff to the next row

Submitted by:  David Lawrence Ramsey <dolorous>
Submitted on:  Fri 22 Feb 2019 03:37:38 AM UTC  
 
Severity:  2 - Minor Status:  Fixed
Assigned to:  Benno Schulenberg <bens> Open/Closed:  Closed

Sun 24 Feb 2019 10:42:25 AM UTC, comment #4: 

On the basis of looking right and my own testing: pushed to master, commit 7c30d1fa.

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Fri 22 Feb 2019 04:55:56 PM UTC, comment #3: 

No problem.  Can't test your version at the moment, but it looks right.

David Lawrence Ramsey <dolorous>
Project Member
Fri 22 Feb 2019 01:17:49 PM UTC, comment #2: 

The patch fixes the case where the line ends with a zero-width character, but not the more general case where a zero-width character follows a double-width character and this latter character sits just before the window's edge, and the two characters are followed by more text.

For example, type an "x" after the zero-width character in your example, then type <Home> and <Del> so that the double-width character would sit at the window's edge, and see how the continuation character ">" gets printed on the next row.

Attached patch fixes it for me.

Thanks for finding an reporting this.

(file #46334)

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Fri 22 Feb 2019 03:40:22 AM UTC, comment #1: 

And the attached patch against git 0f9d60a should fix it.

(file #46332)

David Lawrence Ramsey <dolorous>
Project Member
Fri 22 Feb 2019 03:37:38 AM UTC, original submission:  

This can be reproduced as follows:

1. Run: ./nano -I

2. Type: <M-V> 0 0 3 1 1 3 <M-V> 0 0 2 0 0 B

3. Press <Home>.

4. Hold the spacebar until the double-width character is displayed on the next virtual page (with a '<' on the left edge of the line).

5. Press <Home>.  The double-width character will be erroneously drawn at the beginning of the next line.  (Pressing <Ctrl-L> will fix this.)

The problem is caused by commit 5283acd.  Making display_string() use move_mbleft() broke its handling of zero-width characters just before a continuation character, since move_mbleft() is not always guaranteed to move one column left.

David Lawrence Ramsey <dolorous>
Project Member

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bens (Updated the item)
  • -email is unavailable- added by dolorous (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    Follow 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-03-25 bens Open/ClosedOpen => Closed
    2019-02-24 bens Severity3 - Normal => 2 - Minor
        StatusIn Progress => Fixed
        Assigned toNone => bens
    2019-02-22 bens StatusNone => In Progress
        Summarylines ending with zero-width characters can be displayed on the next line => a zero-width character after a double-width one can push stuff to the next row
    2019-02-22 bens Attached File- => Added 0001-display-account-for-zero-width-characters-when-reser.patch, #46334
    2019-02-22 dolorous Attached File- => Added 0001-display-when-reserving-space-for-account-for-zero-wi.patch, #46332

    Back to the top


    Powered by Savane 3.5