TextEditor: fix clearing of additional formats

Fix a wrong condition that causes closing brace in QML code to remain
highlighted when the code switchs between an invalid to a valid state.

Task-number: QTCREATORBUG-17499
Change-Id: I6b0df3a2b78993426a3d45c9e9af0a28b40104a3
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Marco Benelli
2017-01-13 10:30:41 +01:00
parent ec50c146b3
commit ab711a28ed

View File

@@ -136,7 +136,7 @@ void SemanticHighlighter::clearExtraAdditionalFormatsUntilEnd(
QTextDocument *doc = highlighter->document(); QTextDocument *doc = highlighter->document();
const int firstBlockToClear = lastBlockNumber + 1; const int firstBlockToClear = lastBlockNumber + 1;
if (firstBlockToClear <= doc->blockCount()) if (firstBlockToClear >= doc->blockCount())
return; return;
QTextBlock b = doc->findBlockByNumber(firstBlockToClear); QTextBlock b = doc->findBlockByNumber(firstBlockToClear);