bugGNU nano - Bugs: bug #45640, multiline regexes sometimes see a...

 
 

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

bug #45640: multiline regexes sometimes see a start as an end

Submitter:  Benno Schulenberg <bens>
Submitted:  Mon 27 Jul 2015 06:05:00 PM UTC
   
 
Severity:  3 - Normal Status:  Fixed
Assigned to:  bens Open/Closed:  Closed

Sat 01 Aug 2015 08:49:53 AM UTC, comment #2: 

Fixed in SVN, r5335.

Benno Schulenberg <bens>
Group administrator
Mon 27 Jul 2015 08:30:38 PM UTC, comment #1: 

I don't get it, but attached patch fixes it.  It even fixes a ^K mistakenly colouring lots of lines red.  Great!

Maybe the oring doesn't work because the default value for multidata is not 0 but -1?  Or maybe it doesn't get initialized and contains random data?  Probably then also the other ORs should become plain assignments.

In theory a line could be marked with a combination of CBEGINBEFORE, CSTARTENDHERE and CENDAFTER.  The precalcalculation seems to do this, or intends to do this.  But the actual winio painting code only sets a single value, and that seems to work fine.  So...

(file #34541)

Benno Schulenberg <bens>
Group administrator
Mon 27 Jul 2015 06:05:00 PM UTC, original submission:  

Add the following two lines at the end of your .nanorc:

syntax "tough"
color red start="\"" end="\""

Then start nano with:

stty rows 25  &&  src/nano -x -Y tough +23 NEWS

See how the lines with "lizf" and "Ashley" are coloured in the inverse manner of what is intended.  Weird.

Now do ^Y and see how the "lizf" line is now coloured correctly.  And when doing several ^Vs, also all the other lines are now coloured correctly.

Why does nano get it wrong at startup?  Surely the precalculation must have matched up all the double quotes correctly.  Why then does the painting code go wrong?  It should simply follow the precalculated stuff, then it can't go wrong.

Benno Schulenberg <bens>
Group administrator

 

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

Attached Files

 

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
    2015-12-07 bens Open/ClosedOpen Closed
    2015-08-01 bens StatusIn Progress Fixed
    2015-07-27 bens Attached File- Added set-it-instead-of-oring.patch, #34541
        StatusNone In Progress

    Back to the top

    Powered by Savane 3.13-3230.
    Corresponding source code