forked from qt-creator/qt-creator
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:
@@ -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);
|
||||||
|
Reference in New Issue
Block a user