bugGNU nano - Bugs: bug #50078, things don't get colored with...

 
 

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

bug #50078: things don't get colored with certain zero-length regex matches

Submitter:  Benno Schulenberg <bens>
Submitted:  Wed 18 Jan 2017 05:13:20 PM UTC
   
 
Severity:  3 - Normal Status:  Fixed
Assigned to:  bens Open/Closed:  Closed

Fri 20 Jan 2017 04:37:13 PM UTC, comment #1: 

Fixed in git, 94907aa5.

Benno Schulenberg <bens>
Group administrator
Wed 18 Jan 2017 05:13:20 PM UTC, original submission:  

To reproduce, add these two lines to your ~/.nanorc:

syntax "aha"
color brightred start="^" end="aha"

Now run 'src/nano -Yaha  xxx', and type the following:

so so aha
this is good aha
but
not
now
aha

The first two lines get colored, as expected.  But as you finish the last line, only the word "but" becomes red.  Wrong.  Now save the file, exit, and run the same command again.  Now everything is colored, as it should.  Now move the cursor to the "now" or "not" line and delete a character.  The last three lines lose color again, and don't regain it upon an undo.  If you do the same on the "but" line, no discoloration happens.

Problem was found because of a suspicion: the second "Skip over a zero-length regex match." in src/winio.c doesn't look right.  It shouldn't abandon the line when a zero-length match is found, it should just advance the pointer one step (because there is no point in painting zero characters).  Or maybe not even that; maybe it should advance only over a zero-length end match.

Benno Schulenberg <bens>
Group administrator

 

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

No files currently attached

 

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 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-02-24 bens Open/ClosedOpen Closed
    2017-01-20 bens StatusNone Fixed

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code