bugGNU nano - Bugs: bug #50491, regression when displaying...

 
 

bug #50491: regression when displaying two-column Unicode characters on overlong lines

Submitted by:  David Lawrence Ramsey <dolorous>
Submitted on:  Wed 08 Mar 2017 07:38:36 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.

 

Wed 08 Mar 2017 08:29:06 PM UTC, comment #4:

Fixed in git, 69784d51.

And closing, because unreleased.

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Wed 08 Mar 2017 03:22:40 PM UTC, comment #3:

The patch seems to work just fine. Thanks.

David Lawrence Ramsey <dolorous>
Project Administrator
Wed 08 Mar 2017 01:27:31 PM UTC, comment #2:

Indeed. What happens, though, is not the dollar sign being "overwritten" by the two-column character, but getting pushed "over the edge of the screen" by it. This can be seen when doing 'stty cols 60 && src/nano +2,43 chinese.html' and pressing <Del>: the $ gets printed outside of the terminal, outside of sixty columns -- and if the terminal is actually 60 characters wide, it gets pushed to the next row.

Hmm... Yes, I had made the 355a07bb change before, and noticed the misbehavior with double-width characters myself, but had forgotten about that.

Okay, attached patch should fix that, without reintroducing the costly strlenpt(). Please see how you fare.

(file #39942)

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Wed 08 Mar 2017 08:42:43 AM UTC, comment #1:

Forgot to mention: the previous instructions need an 80x24 terminal.

David Lawrence Ramsey <dolorous>
Project Administrator
Wed 08 Mar 2017 07:38:36 AM UTC, original submission:

In current git, when dealing with the attached file (taken from a different bug report regarding 2-column Unicode), nano displays the dollar sign at the end of the overlong line at the wrong place under certain circumstances. This can be reproduced as follows, assuming UTF-8 is being used:

1. Run "nano --ignore +2,43 chinese.html". This will put the cursor directly on the space in the middle of the line.

2. Press Delete to remove the space. Even though the line is still too long for the screen, the dollar sign at the end of the line will disappear, overwritten entirely by the two-column Unicode character at the edge of the screen. Furthermore, the character at the beginning of the next line will erroneously change to a dollar sign.

The problem does not occur in nano 2.7.5, and seems to be caused by commit 355a07b in current git, because if I revert that commit, the problem goes away.

David Lawrence Ramsey <dolorous>
Project Administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #39933:  chinese.html added by dolorous (916B - text/html)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by bens (Updated the item)
  • -unavailable- added by dolorous (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 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 16 Mar 2017 06:34:35 PM UTCbensOpen/ClosedOpen=>Closed
    Wed 08 Mar 2017 08:29:06 PM UTCbensStatusNone=>Fixed
      Assigned toNone=>bens
    Wed 08 Mar 2017 01:27:31 PM UTCbensAttached File-=>Added check-for-remaining-stuff-at-the-end.patch, #39942
      Summaryregression wrt displaying 2-column Unicode characters on overlong lines=>regression when displaying two-column Unicode characters on overlong lines
    Wed 08 Mar 2017 07:38:36 AM UTCdolorousAttached File-=>Added chinese.html, #39933

    Back to the top


    Powered by Savane 3.1-cleanup1