Editor: Fix animate matching parenthesis in folded code

Task-number: QTCREATORBUG-5877

Change-Id: I1012a1f8d8f925ed1a002d457b856df103e9f703
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:03:10 +01:00
parent a0974004af
commit f224c68b32

View File

@@ -5090,9 +5090,6 @@ void BaseTextEditorWidget::_q_matchParentheses()
extraSelections.append(sel);
} else {
if (d->m_displaySettings.m_animateMatchingParentheses)
animatePosition = backwardMatch.selectionStart();
sel.cursor = backwardMatch;
sel.format = d->m_matchFormat;
@@ -5100,6 +5097,9 @@ void BaseTextEditorWidget::_q_matchParentheses()
sel.cursor.movePosition(QTextCursor::NextCharacter, 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);
extraSelections.append(sel);
@@ -5114,9 +5114,6 @@ void BaseTextEditorWidget::_q_matchParentheses()
extraSelections.append(sel);
} else {
if (d->m_displaySettings.m_animateMatchingParentheses)
animatePosition = forwardMatch.selectionEnd()-1;
sel.cursor = forwardMatch;
sel.format = d->m_matchFormat;
@@ -5125,6 +5122,9 @@ void BaseTextEditorWidget::_q_matchParentheses()
extraSelections.append(sel);
sel.cursor.setPosition(forwardMatch.selectionEnd());
if (d->m_displaySettings.m_animateMatchingParentheses && sel.cursor.block().isVisible())
animatePosition = forwardMatch.selectionEnd() - 1;
sel.cursor.movePosition(QTextCursor::PreviousCharacter, QTextCursor::KeepAnchor);
extraSelections.append(sel);
}