--- a/QScintilla/Lexers/LexerPygments.py Fri May 24 18:39:58 2013 +0200 +++ b/QScintilla/Lexers/LexerPygments.py Tue May 28 20:52:12 2013 +0200 @@ -449,7 +449,7 @@ cpos += tlen if tlen and cpos < textLen: self.editor.setStyling(tlen, style) - else: + if cpos >= textLen: break self.editor.startStyling(cpos, 0x3f)