bugGNU nano - Bugs: bug #52925, with an EOL regex a needed color...

 
 

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

bug #52925: with an EOL regex a needed color change is not always detected

Submitter:  Benno Schulenberg <bens>
Submitted:  Thu 18 Jan 2018 05:15:49 PM UTC
   
 
Severity:  3 - Normal Status:  Fixed
Assigned to:  bens Open/Closed:  Closed

Tue 23 Jan 2018 01:00:21 PM UTC, comment #3: 

Fixed in git, commit d5f9be7d.

Benno Schulenberg <bens>
Group administrator
Thu 18 Jan 2018 08:44:13 PM UTC, comment #2: 

The problem was that "astart" and "anend" just looked in the whole line for a start match and an end match.  But if there is a start match, then it should look for an end match only after the start match.  Attach patch implements that.

(file #42966)

Benno Schulenberg <bens>
Group administrator
Thu 18 Jan 2018 07:42:25 PM UTC, comment #1: 

The offending commit was 5765e967.  But that commit fixed another problem with <Delete> not updating the colors: bug #46794.

Benno Schulenberg <bens>
Group administrator
Thu 18 Jan 2018 05:15:49 PM UTC, original submission:  

To reproduce, add these two lines at the end of your .nanorc:

  syntax "endof"
  color brightred start="#pragma" end="[^\]$"

Then run 'nano -Yendof blah' and type these two lines:

  #pragma
  blah blah

Note that both lines get colored bright red as soon as the first "b" is typed.  Now position the cursor after "pragma" and type a space.  The "blah blah" line stops being colored, which is correct, because now the "end=" part matches the typed space at the end of the first line.  But... now remove the space again, by typing Backspace.  The color does not return on the second line!  Wrong.

(If instead of using <Backspace> (or <Left> and then <Delete), you type <Shift+Left> and ^K, then the color does return.)

(Bug was found after trying some regexes posted by Liu Hao: http://lists.gnu.org/archive/html/nano-devel/2017-12/msg00061.html.)

Bug exists since at least nano-2.5.3 -- 2.4.3 was still okay.

Benno Schulenberg <bens>
Group administrator

 

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

 

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

    Date Changed by Updated Field Previous Value => Replaced by
    2018-01-30 bens Open/ClosedOpen Closed
    2018-01-23 bens StatusIn Progress Fixed
    2018-01-18 bens Attached File- Added 0001-color-look-for-an-end-match-only-after-a-start-match.patch, #42966
        StatusNone In Progress
        Assigned toNone bens

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code