bugGNU nano - Bugs: bug #27708, Syntax highlighting to select EOF

 
 

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

bug #27708: Syntax highlighting to select EOF

Submitted by:  None
Submitted on:  Thu 15 Oct 2009 12:07:21 AM UTC  
 
Severity:  3 - Normal Status:  Fixed
Assigned to:  Benno Schulenberg <bens> Open/Closed:  Closed

Sun 18 May 2014 10:52:53 AM UTC, comment #5: 

Understood.  It was somewhat to be expected, four years later.  :)
Thanks for reporting back.  The change has gone into SVN, r4903.

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Sat 17 May 2014 10:09:13 PM UTC, comment #4: 

Benno, thanks for looking at this.

Currently, I do not use these features of nano anymore and will not build from svn just to test, sorry. I guess that if the cycling behavior of the highlighting is fixed by your patch, the bug I reported is fixed (the other part was effectively a feature request) and this bug may then be closed as far as I'm concerned.

Erik Quaeghebeur <equaeghe>
Sat 17 May 2014 09:48:41 PM UTC, comment #3: 

Although I don't understand what the original bug submitter was trying to do, yes it would be useful to have a regex anchor that would match only the actual EOF.  But there isn't.

To mark email signatures, using end=".$" would only colour the first non-blank line after the "-- " marker.  (That is: if the colouring code worked correctly.)  But what it seems you want, Erik, is to have all lines after "-- " coloured.  That could be accomplished by demanding that the signature ends with a blank line (a double newline).  That is not too demanding, I think -- who does not hit Enter at the end of any completed line?

So I would propose:

  color yellow start="^-- $" end="^$"

With the current code that colours only the "-- " marker itself, but that is because the colouring code makes a mistake: when searching for the end, it forgets that the point in the string where it starts searching should not be interpreted as the beginning of a line.  With the attached patch (and current SVN) and the above rule, I get multiline email signatures to colour properly.  Please test and report back, if you can.

(file #31397)

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Sat 29 May 2010 06:25:00 AM UTC, comment #2: 

This would be useful for me (currently using 2.2.2 on ubuntu 10.04): I'm trying to get syntax highlighting for email signatures

color yellow start="^-- $" end=".$"

does one-line signatures ok, but once a second line is added strange things start happening: when walking over the different lines of the signature (including "-- "-line), the second line cycles from yellow to unhighlighted.

Erik Quaeghebeur <equaeghe>
Thu 15 Oct 2009 04:48:09 PM UTC, comment #1: 

Scratch that,

color white,blue start="\?>" end="."

seems to have fixed it.

Anonymous
Thu 15 Oct 2009 12:07:21 AM UTC, original submission:  

I'm writing a syntax highlighter for PHP. To highlight plain HTML within a PHP script, these lines work:

color white,blue start="\?>" end="<\?php"
color white,blue start="^" end="<\?php"

But this doesn't:

color white,blue start="\?>" end="$"

I've also tried end="".

Anonymous

 

Attached Files
file #31397:  nano--notbol.patch added by bens (533B - 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 (Updated the item)
  • -email is unavailable- added by equaeghe (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-05-18 bens StatusNeed Info => Fixed
        Open/ClosedOpen => Closed
    2014-05-17 bens Attached File- => Added nano--notbol.patch, #31397
        StatusNone => Need Info
        Assigned toNone => bens

    Back to the top


    Powered by Savane 3.5