diff --git a/pglab/SqlSyntaxHighlighter.cpp b/pglab/SqlSyntaxHighlighter.cpp index d61b08e..e5d0f11 100644 --- a/pglab/SqlSyntaxHighlighter.cpp +++ b/pglab/SqlSyntaxHighlighter.cpp @@ -46,7 +46,7 @@ void SqlSyntaxHighlighter::highlightBlock(const QString &text) int startpos, length; BasicTokenType tokentype; QString s; - while (lexer.nextBasicToken(startpos, length, tokentype, s)) { + while (lexer.nextBasicToken(startpos, length, tokentype, s) && tokentype != BasicTokenType::End) { switch (tokentype) { case BasicTokenType::None: case BasicTokenType::End: // End of input