Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
Python lexer
Stevo:
You are however correct in that i left the default hilight color for decorators as the DEFAULT text color, but that wasnt the problem i was describing.
The problem i was talking about is:
@classmethod # This is a decorator
The decorator color highlights the entire line up until the EOL. It should stop at the #, which is a comment or EOL (whichever comes first). The Lexer in scintilla doesnt end the decorator state, until EOL< it should also check for a comment, and change state.
The code to fix is pretty straight forward, i just havent had a chance to implement it and test yet. I actually think its an underlying scintilla problem, but i havent tracked it back to see where it originates yet.
Stevo
sethjackson:
--- Quote from: Stevo on January 22, 2006, 08:12:46 am ---You are however correct in that i left the default hilight color for decorators as the DEFAULT text color, but that wasnt the problem i was describing.
The problem i was talking about is:
@classmethod # This is a decorator
The decorator color highlights the entire line up until the EOL. It should stop at the #, which is a comment or EOL (whichever comes first). The Lexer in scintilla doesnt end the decorator state, until EOL< it should also check for a comment, and change state.
The code to fix is pretty straight forward, i just havent had a chance to implement it and test yet. I actually think its an underlying scintilla problem, but i havent tracked it back to see where it originates yet.
Stevo
--- End quote ---
Ok check out the String EOL style in the Python lexer maybe that will help you..... I'm just shooting in the dark, but it seems to me that if it was a bug it would have been found and fixed long ago......
Stevo:
Here is a patch to fix the python lexer is scintilla, so that decorators end at a comment, as well as at the end of the line.
It is a bug, it probably hasnt been found before, because its a pretty minor issue, and it doesnt hurt anyone, its also probably unusual to put comments on decorators.
It looks like the person who added decorator highlighting just copied the logic for comment highlighting, but forgot the case where a decorator is terminated by a comment.
It is a bug in scintilla the attached patch is also being sent to wxscintilla and scintilla projects for completeness.
Stevo
[attachment deleted by admin]
mandrav:
Stevo, thanks for the patch. Please submit it to our patch tracker, not here...
Stevo:
--- Quote from: mandrav on January 23, 2006, 08:48:03 am ---Stevo, thanks for the patch. Please submit it to our patch tracker, not here...
--- End quote ---
Done.
Navigation
[0] Message Index
[*] Previous page
Go to full version