bugGNU nano - Bugs: bug #49978, pressing <Enter> on a long...

 
 

bug #49978: pressing <Enter> on a long HTML line makes the tail lose color

Submitted by:  Benno Schulenberg <bens>
Submitted on:  Tue 03 Jan 2017 04:10:43 PM 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.

 

Sun 08 Jan 2017 02:32:21 PM UTC, comment #4:

Fixed in git, 8177e62c.

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Tue 03 Jan 2017 08:17:21 PM UTC, comment #3:

The problem is: when painting the line, and there is no precalculated info yet, then the line gets examined for painting only for the width of the screen -- the part that nano thinks is visible. But this then means that the multiline info gets set to CNONE, which in this case is wrong, and this causes the line to not be examined all in each subsequent repainting.

So, to fix this, don't just examine the line until edge of screen but until infinity -- that is: until falling off the end of the line. See attached patch. (This will slow things down when the file has lots of very long lines and we aren't softwrapping, but... we'll see.)

(file #39357)

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Tue 03 Jan 2017 06:37:02 PM UTC, comment #2:

I don't see how to fix this with a minor local adjustment. What does work is to just do a full recalculation of the multiline color info whenever <Enter> is hit. See attached one-line patch.

(file #39355)

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Tue 03 Jan 2017 04:51:46 PM UTC, comment #1:

The offending commit seems to be b1d6d7f9. However, the problem exists also /before/ 2.5.0, it was just /hidden/ because I use MALLOC_PERTURB_. :| With MALLOC_PERTURB_ unset, the problem goes back to at least 2.2.1.

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Tue 03 Jan 2017 04:10:43 PM UTC, original submission:

To reproduce, run 'src/nano --soft +87,27 doc/faq.html'. Notice how at the end of this line (which is 477 characters long) the tags </p></blockquote> are colored in cyan. Now press <Enter>. Oh! The tags are now uncolored.

Typing now < and M-U somewhere in the first row of the current line (that is: the unwrapped part) will cause the tags to recover color. But when making edits in the softwrapped rows will not cause any color changes. Weird!

But it's only /tags/ that are affected. Strings ("boo!") and codes (&quot;) are not affected. So it has to do with multiline regexes.

The bug exists since nano-2.5.0. It exists also without using --softwrap, but then it is harder to notice. (A similar bug existed in 2.3.2 and 2.2.* when doing <Enter> M-U M-E.)

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #39357:  examine-whole-line.patch added by bens (1KiB - text/x-diff)
file #39355:  always-recalculate.patch added by bens (301B - text/x-diff)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by bens (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
    Wed 11 Jan 2017 10:54:12 AM UTCbensOpen/ClosedOpen=>Closed
    Sun 08 Jan 2017 02:32:21 PM UTCbensStatusIn Progress=>Fixed
      Summarypressing <Enter> on a long line makes the tail lose color=>pressing on a long HTML line makes the tail lose color
    Tue 03 Jan 2017 08:17:21 PM UTCbensAttached File-=>Added examine-whole-line.patch, #39357
      StatusNone=>In Progress
    Tue 03 Jan 2017 06:37:02 PM UTCbensAttached File-=>Added always-recalculate.patch, #39355

    Back to the top


    Powered by Savane 3.1-cleanup1