From 20ec30223c95c49b7512de13add5edb77453352c Mon Sep 17 00:00:00 2001
From: mae <qt-info@nokia.com>
Date: Wed, 17 Feb 2010 16:02:47 +0100
Subject: [PATCH] Block highlight works incorrectly with methods having
 parameters split in several lines

task-number: QTCREATORBUG-611
---
 src/plugins/texteditor/basetexteditor.cpp | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/plugins/texteditor/basetexteditor.cpp b/src/plugins/texteditor/basetexteditor.cpp
index b9ced9c9a41..3bc8283b1b0 100644
--- a/src/plugins/texteditor/basetexteditor.cpp
+++ b/src/plugins/texteditor/basetexteditor.cpp
@@ -4733,11 +4733,14 @@ void BaseTextEditor::_q_highlightBlocks()
             while (TextBlockUserData::findPreviousBlockOpenParenthesis(&cursor, firstRun)) {
                 firstRun = false;
                 highlightBlocksInfo.open.prepend(cursor.blockNumber());
-                highlightBlocksInfo.visualIndent.prepend(d->visualIndent(cursor.block()));
+                int visualIndent = d->visualIndent(cursor.block());
                 if (closeCursor.isNull())
                     closeCursor = cursor;
-                if (TextBlockUserData::findNextBlockClosingParenthesis(&closeCursor))
+                if (TextBlockUserData::findNextBlockClosingParenthesis(&closeCursor)) {
                     highlightBlocksInfo.close.append(closeCursor.blockNumber());
+                    visualIndent = qMin(visualIndent, d->visualIndent(closeCursor.block()));
+                }
+                highlightBlocksInfo.visualIndent.prepend(visualIndent);
             }
         }
     }
-- 
GitLab