From ab711a28ed34f594d41341042664312e323af4d7 Mon Sep 17 00:00:00 2001 From: Marco Benelli Date: Fri, 13 Jan 2017 10:30:41 +0100 Subject: [PATCH] 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 --- src/plugins/texteditor/semantichighlighter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/texteditor/semantichighlighter.cpp b/src/plugins/texteditor/semantichighlighter.cpp index 31033815604..fa388ac40e0 100644 --- a/src/plugins/texteditor/semantichighlighter.cpp +++ b/src/plugins/texteditor/semantichighlighter.cpp @@ -136,7 +136,7 @@ void SemanticHighlighter::clearExtraAdditionalFormatsUntilEnd( QTextDocument *doc = highlighter->document(); const int firstBlockToClear = lastBlockNumber + 1; - if (firstBlockToClear <= doc->blockCount()) + if (firstBlockToClear >= doc->blockCount()) return; QTextBlock b = doc->findBlockByNumber(firstBlockToClear);