From 5442e745e71ed73d3b93c0f1136e2eb1d0d9fcf5 Mon Sep 17 00:00:00 2001 From: Lukas Holecek Date: Mon, 24 Sep 2012 19:29:26 +0200 Subject: [PATCH] Highlight matching parentheses under text cursor In replace mode highlight parentheses that are right under the block cursor. Change-Id: I6cef5fe302b0797c66ed9541d28ec495fb1db1d1 Reviewed-by: David Schulz --- src/plugins/texteditor/basetexteditor.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/texteditor/basetexteditor.cpp b/src/plugins/texteditor/basetexteditor.cpp index 76a217f67b6..1d6a55861c7 100644 --- a/src/plugins/texteditor/basetexteditor.cpp +++ b/src/plugins/texteditor/basetexteditor.cpp @@ -5015,6 +5015,8 @@ void BaseTextEditorWidget::_q_matchParentheses() QTextCursor backwardMatch = textCursor(); QTextCursor forwardMatch = textCursor(); + if (overwriteMode()) + backwardMatch.movePosition(QTextCursor::Right); const TextBlockUserData::MatchType backwardMatchType = TextBlockUserData::matchCursorBackward(&backwardMatch); const TextBlockUserData::MatchType forwardMatchType = TextBlockUserData::matchCursorForward(&forwardMatch);