Fri, 20 Jan 2012 18:54:06 +0100
Fixed an issue with the Pygments lexer because it is ignoring trailing empty lines.
QScintilla/Lexers/LexerPygments.py | file | annotate | diff | comparison | revisions |
--- a/QScintilla/Lexers/LexerPygments.py Wed Jan 18 19:59:42 2012 +0100 +++ b/QScintilla/Lexers/LexerPygments.py Fri Jan 20 18:54:06 2012 +0100 @@ -425,6 +425,13 @@ self.__lexer = self.__guessLexer(text) cpos = 0 + # adjust start position because pygments ignores empty line at start of text + for c in text: + if c == "\n": + cpos += 1 + else: + break + self.editor.startStyling(cpos, 0x3f) if self.__lexer is None: self.editor.setStyling(len(text), PYGMENTS_DEFAULT)