From 6acf70660b7e689b8555b0eef6d4a8656ea54471 Mon Sep 17 00:00:00 2001 From: eelke Date: Tue, 29 Jan 2019 20:36:07 +0100 Subject: [PATCH] Fix: hang in syntax highlighter SqlLexer was changed to correctly report end of file. Which this code didn't handle --- pglab/SqlSyntaxHighlighter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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