Editor: Fix highlighting issue after code unfold.

Task-number: QTCREATORBUG-8232

Change-Id: I2595855bb7efe669e3c48a16ab162ace54f7015a
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
Reviewed-by: David Schulz <david.schulz@digia.com>
This commit is contained in:
David Schulz
2012-11-12 13:46:17 +01:00
parent f224c68b32
commit 5aa0412b8e

View File

@@ -5094,14 +5094,14 @@ void BaseTextEditorWidget::_q_matchParentheses()
sel.format = d->m_matchFormat;
sel.cursor.setPosition(backwardMatch.selectionStart());
sel.cursor.movePosition(QTextCursor::NextCharacter, QTextCursor::KeepAnchor);
sel.cursor.setPosition(sel.cursor.position() + 1, QTextCursor::KeepAnchor);
extraSelections.append(sel);
if (d->m_displaySettings.m_animateMatchingParentheses && sel.cursor.block().isVisible())
animatePosition = backwardMatch.selectionStart();
sel.cursor.setPosition(backwardMatch.selectionEnd());
sel.cursor.movePosition(QTextCursor::PreviousCharacter, QTextCursor::KeepAnchor);
sel.cursor.setPosition(sel.cursor.position() - 1, QTextCursor::KeepAnchor);
extraSelections.append(sel);
}
}
@@ -5118,15 +5118,15 @@ void BaseTextEditorWidget::_q_matchParentheses()
sel.format = d->m_matchFormat;
sel.cursor.setPosition(forwardMatch.selectionStart());
sel.cursor.movePosition(QTextCursor::NextCharacter, QTextCursor::KeepAnchor);
sel.cursor.setPosition(sel.cursor.position() + 1, QTextCursor::KeepAnchor);
extraSelections.append(sel);
sel.cursor.setPosition(forwardMatch.selectionEnd());
sel.cursor.setPosition(sel.cursor.position() - 1, QTextCursor::KeepAnchor);
extraSelections.append(sel);
if (d->m_displaySettings.m_animateMatchingParentheses && sel.cursor.block().isVisible())
animatePosition = forwardMatch.selectionEnd() - 1;
sel.cursor.movePosition(QTextCursor::PreviousCharacter, QTextCursor::KeepAnchor);
extraSelections.append(sel);
}
}