patchGNU nano - Patches: patch #7561, slightly improve highlighting of...

 
 

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

patch #7561: slightly improve highlighting of multiline strings in Python

Submitter:  Konstantin <abakumov>
Submitted:  Fri 24 Jun 2011 07:00:15 PM UTC
   
 
Priority:  3 - Low Status:  Done
Privacy:  Public Assigned to:  bens
Open/Closed:  Closed Release:  None

Wed 26 Feb 2014 12:39:11 PM UTC, comment #2: 

Thanks.  The suggested change is in SVN now.

(By the way, a good explanation of why the highlighting of triple-quoted strings in Python cannot work flawlessly in principle is given in bug #26762.)

Benno Schulenberg <bens>
Group administrator
Mon 27 Jun 2011 09:48:29 PM UTC, comment #1: 

I can confirm that Konstantin's change fixes that example. However, highlighting still seems to be broken if the opening """ is at the end of a line, e.g.

print("""
Hello, world!
""")

Ryan Lothian <ryanlothian>
Fri 24 Jun 2011 07:00:15 PM UTC, original submission:  

Here's an example of code, on which highliting is wrong:

print('''comment1''')
a = 1
b = a * 2  #All lines between comment1 and comment2 are highlighted as a comment
c = b / 2
print('''comment2''')

There is a problem when a multiline comment ends not in the end of line. In this case all the text from the end of comment up to the next multiline comment considered to be a comment too.

this can be fixed by replacing the line

color brightgreen start=""""[^"]" end=""""" start="'''[^']" end="'''"

by

color brightgreen start="\"\"\"[^"]" end="\"\"\"" start="\'\'\'[^']" end="\'\'\'"

Fixed file attached


Konstantin <abakumov>

 

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

Attached Files
file #23554:  python.nanorc added by abakumov (507B - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bens (Posted a comment)
  • -email is unavailable- added by ryanlothian (Posted a comment)
  • -email is unavailable- added by abakumov (Submitted the item)
  • -email is unavailable- added by abakumov
  •  

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

    Date Changed by Updated Field Previous Value => Replaced by
    2014-02-26 bens StatusNone Done
        Assigned toNone bens
        Open/ClosedOpen Closed
        SummaryPython multiline comments highlighting issue slightly improve highlighting of multiline strings in Python
    2011-06-24 abakumov Attached File- Added python.nanorc, #23554
        Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code