Commit 87b8a974 authored by Matthias Ettrich's avatar Matthias Ettrich
Browse files

fix off by one when selecting block up or the previous open parenthesis.

parent a003b62a
......@@ -3115,8 +3115,9 @@ bool TextBlockUserData::findPreviousOpenParenthesis(QTextCursor *cursor, bool se
if (!parenList.isEmpty() && !TextEditDocumentLayout::ifdefedOut(block)) {
for (int i = parenList.count()-1; i >= 0; --i) {
Parenthesis paren = parenList.at(i);
if (block == cursor->block() && position - block.position() <= paren.pos + 1)
continue;
if (block == cursor->block() &&
(position - block.position() <= paren.pos + (paren.type == Parenthesis::Closed ? 1 : 0)))
continue;
if (paren.type == Parenthesis::Closed) {
++ignore;
} else if (ignore > 0) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment