CppEditor: Fix clearing of "semantic parentheses"

Amends a0bf5448a1.

Change-Id: I0a89834ade9b5df7aa976278fdc5761eb1c0ac24
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Kandeler
2021-09-20 15:13:44 +02:00
parent 75854d57ef
commit 08f3c10bf5

View File

@@ -241,9 +241,14 @@ void SemanticHighlighter::onHighlighterFinished()
} else {
firstResultBlock = m_baseTextDocument->document()->findBlockByNumber(
m_watcher->resultAt(0).line - 1);
lastResultBlock = m_baseTextDocument->document()->findBlockByNumber(
m_watcher->future().resultAt(m_watcher->future().resultCount() - 1).line - 1);
const HighlightingResult &lastResult
= m_watcher->future().resultAt(m_watcher->future().resultCount() - 1);
const QTextBlock lastResultStartBlock
= m_baseTextDocument->document()->findBlockByNumber(lastResult.line - 1);
lastResultBlock = m_baseTextDocument->document()->findBlock(
lastResultStartBlock.position() + lastResult.column - 1 + lastResult.length);
}
for (QTextBlock currentBlock = m_baseTextDocument->document()->firstBlock();
currentBlock != firstResultBlock; currentBlock = currentBlock.next()) {
TextDocumentLayout::setParentheses(currentBlock, getClearedParentheses(currentBlock));