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

 
 

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

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

Submitter:  Benno Schulenberg <bens>
Submitted:  Tue 15 Mar 2016 04:14:09 PM UTC
   
 
Severity:  2 - Minor Status:  Fixed
Assigned to:  bens Open/Closed:  Closed

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>
Group administrator
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>
Group administrator

 

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

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
  • -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 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-07-30 bens Open/ClosedOpen Closed
    2016-07-03 bens StatusReady For Test Fixed
    2016-03-20 bens StatusNone Ready For Test
    2016-03-15 bens Attached File- Added reset-them-harder.patch, #36653

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code