bugGNU nano - Bugs: bug #47420, enduring discoloring even after...

 
 

bug #47420: enduring discoloring even after restoring a triple quote

Submitted by:  Benno Schulenberg <bens>
Submitted on:  Tue 15 Mar 2016 04:14:09 PM UTC  
 
Severity: 2 - MinorStatus: 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 03 Jul 2016 03:53:47 PM UTC, comment #1:

Patch has been applied in git, 4af1da7. As far as I can tell, it does not make anything worse, and improves a few situations. The full fix would be to reset everything and recalculate all the data from scratch. For large files this is certainly faster, so for small files it would be faster too?

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Tue 15 Mar 2016 04:14:09 PM UTC, original submission:

When for a certain color the start= and end= regexes are equal (or at least can sometimes match the exact same string), then after breaking and then restoring the start string things remain colored in a wrong manner.

To reproduce, add the following three lines at the end of your .nanorc:

syntax "snake"
color brightred "^#.*"
color green start=""""([^"]|$)" end="(^|[^"])""""

Then start nano with 'src/nano -Ysnake', and paste the following ten lines into it:

"""
One
"""

#comment
statement

"""
Two
"""

Now, you can delete any double quote in any of the latter three triplets and then restore it, and colorings will return to what they should be. But if you do that for the first triplet (delete a quote and then restore it), then the comment and the statement will remain green. Typing then an extra quote will restore the proper colorings.

This latter behavior inspired the attached patch.

If instead of typing an extra quote, you delete the earlier deleted quote again, then not only the first two lines but also the last two lines become discolored. Only typing an extra quote again (after putting back the missing quote) will restore the proper coloring.

I will see how the patch fares in other circumstances...

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 #36653:  reset-them-harder.patch added by bens (477B - 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 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 30 Jul 2016 09:05:49 AM UTCbensOpen/ClosedOpen=>Closed
    Sun 03 Jul 2016 03:53:47 PM UTCbensStatusReady For Test=>Fixed
    Sun 20 Mar 2016 02:00:34 PM UTCbensStatusNone=>Ready For Test
    Tue 15 Mar 2016 04:14:09 PM UTCbensAttached File-=>Added reset-them-harder.patch, #36653

    Back to the top


    Powered by Savane 3.1-cleanup1