forked from qt-creator/qt-creator
fix off by one when selecting block up or the previous open parenthesis.
This commit is contained in:
@@ -3115,8 +3115,9 @@ bool TextBlockUserData::findPreviousOpenParenthesis(QTextCursor *cursor, bool se
|
|||||||
if (!parenList.isEmpty() && !TextEditDocumentLayout::ifdefedOut(block)) {
|
if (!parenList.isEmpty() && !TextEditDocumentLayout::ifdefedOut(block)) {
|
||||||
for (int i = parenList.count()-1; i >= 0; --i) {
|
for (int i = parenList.count()-1; i >= 0; --i) {
|
||||||
Parenthesis paren = parenList.at(i);
|
Parenthesis paren = parenList.at(i);
|
||||||
if (block == cursor->block() && position - block.position() <= paren.pos + 1)
|
if (block == cursor->block() &&
|
||||||
continue;
|
(position - block.position() <= paren.pos + (paren.type == Parenthesis::Closed ? 1 : 0)))
|
||||||
|
continue;
|
||||||
if (paren.type == Parenthesis::Closed) {
|
if (paren.type == Parenthesis::Closed) {
|
||||||
++ignore;
|
++ignore;
|
||||||
} else if (ignore > 0) {
|
} else if (ignore > 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user