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

Submitted by:  Konstantin <abakumov>
Submitted on:  Fri 24 Jun 2011 07:00:15 PM UTC  
Priority: 3 - LowStatus: Done
Privacy: PublicAssigned to: Benno Schulenberg <bens>
Open/Closed: ClosedRelease: 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>
Project AdministratorIn charge of this item.
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.

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:

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

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="'''"


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

Fixed file attached

Konstantin <abakumov>


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
  • -unavailable- added by bens (Posted a comment)
  • -unavailable- added by ryanlothian (Posted a comment)
  • -unavailable- added by abakumov (Submitted the item)
  • -unavailable- added by abakumov

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

    Only logged-in users can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 26 Feb 2014 12:39:11 PM UTCbensStatusNone=>Done
      Assigned toNone=>bens
      SummaryPython multiline comments highlighting issue=>slightly improve highlighting of multiline strings in Python
    Fri 24 Jun 2011 07:00:15 PM UTCabakumovAttached File-=>Added python.nanorc, #23554
      Carbon-Copy-=>Added -unavailable-

    Back to the top

    Powered by Savane 3.1-cleanup1