forked from qt-creator/qt-creator
CppEditor: Fix clearing of "semantic parentheses"
Amends a0bf5448a1
.
Change-Id: I0a89834ade9b5df7aa976278fdc5761eb1c0ac24
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -241,9 +241,14 @@ void SemanticHighlighter::onHighlighterFinished()
|
|||||||
} else {
|
} else {
|
||||||
firstResultBlock = m_baseTextDocument->document()->findBlockByNumber(
|
firstResultBlock = m_baseTextDocument->document()->findBlockByNumber(
|
||||||
m_watcher->resultAt(0).line - 1);
|
m_watcher->resultAt(0).line - 1);
|
||||||
lastResultBlock = m_baseTextDocument->document()->findBlockByNumber(
|
const HighlightingResult &lastResult
|
||||||
m_watcher->future().resultAt(m_watcher->future().resultCount() - 1).line - 1);
|
= 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();
|
for (QTextBlock currentBlock = m_baseTextDocument->document()->firstBlock();
|
||||||
currentBlock != firstResultBlock; currentBlock = currentBlock.next()) {
|
currentBlock != firstResultBlock; currentBlock = currentBlock.next()) {
|
||||||
TextDocumentLayout::setParentheses(currentBlock, getClearedParentheses(currentBlock));
|
TextDocumentLayout::setParentheses(currentBlock, getClearedParentheses(currentBlock));
|
||||||
|
Reference in New Issue
Block a user