Fix: hang in syntax highlighter

SqlLexer was changed to correctly report end of file. Which this code didn't handle
This commit is contained in:
eelke 2019-01-29 20:36:07 +01:00
parent 27fde22d54
commit 6acf70660b

View file

@ -46,7 +46,7 @@ void SqlSyntaxHighlighter::highlightBlock(const QString &text)
int startpos, length; int startpos, length;
BasicTokenType tokentype; BasicTokenType tokentype;
QString s; QString s;
while (lexer.nextBasicToken(startpos, length, tokentype, s)) { while (lexer.nextBasicToken(startpos, length, tokentype, s) && tokentype != BasicTokenType::End) {
switch (tokentype) { switch (tokentype) {
case BasicTokenType::None: case BasicTokenType::None:
case BasicTokenType::End: // End of input case BasicTokenType::End: // End of input