From 9f737301b4dc386f487349803e1975d7026b17cf Mon Sep 17 00:00:00 2001 From: Christian Kamm Date: Sun, 14 Oct 2012 10:42:49 +0200 Subject: [PATCH] Editor: Fix finding block parentheses. The '[' and ']' characters were considered block-opening/closing. That led to bad results in the autocompleter (the only user of these functions). Task-number: QTCREATORBUG-8031 Change-Id: I81b464b2591d3695baad6e9630f9bcc4aa4ef795 Reviewed-by: Erik Verbruggen --- src/plugins/texteditor/basetextdocumentlayout.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/plugins/texteditor/basetextdocumentlayout.cpp b/src/plugins/texteditor/basetextdocumentlayout.cpp index a9f33c15466..53826856cb1 100644 --- a/src/plugins/texteditor/basetextdocumentlayout.cpp +++ b/src/plugins/texteditor/basetextdocumentlayout.cpp @@ -390,8 +390,7 @@ bool TextBlockUserData::findPreviousBlockOpenParenthesis(QTextCursor *cursor, bo for (int i = parenList.count()-1; i >= 0; --i) { Parenthesis paren = parenList.at(i); if (paren.chr != QLatin1Char('{') && paren.chr != QLatin1Char('}') - && paren.chr != QLatin1Char('+') && paren.chr != QLatin1Char('-') - && paren.chr != QLatin1Char('[') && paren.chr != QLatin1Char(']')) + && paren.chr != QLatin1Char('+') && paren.chr != QLatin1Char('-')) continue; if (block == cursor->block()) { if (position - block.position() <= paren.pos + (paren.type == Parenthesis::Closed ? 1 : 0)) @@ -454,8 +453,7 @@ bool TextBlockUserData::findNextBlockClosingParenthesis(QTextCursor *cursor) for (int i = 0; i < parenList.count(); ++i) { Parenthesis paren = parenList.at(i); if (paren.chr != QLatin1Char('{') && paren.chr != QLatin1Char('}') - && paren.chr != QLatin1Char('+') && paren.chr != QLatin1Char('-') - && paren.chr != QLatin1Char('[') && paren.chr != QLatin1Char(']')) + && paren.chr != QLatin1Char('+') && paren.chr != QLatin1Char('-')) continue; if (block == cursor->block() && (position - block.position() > paren.pos - (paren.type == Parenthesis::Opened ? 1 : 0)))