forked from qt-creator/qt-creator
Double-click to select current block
This is a Eclipse-like feature, for select enclosing element.
e.g.
int test() {| // Here is the cursor position
...
}
When Double-click, we can select the block: {...}
I think this is a useful feature.
Change-Id: I4ca7ed04056176195d1622714effda9079ae0e44
Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
This commit is contained in:
committed by
Leandro Melo
parent
05d8aeae8d
commit
18b675d32f
@@ -201,7 +201,7 @@ TextBlockUserData::MatchType TextBlockUserData::checkClosedParenthesis(QTextCurs
|
||||
}
|
||||
}
|
||||
|
||||
bool TextBlockUserData::findPreviousOpenParenthesis(QTextCursor *cursor, bool select)
|
||||
bool TextBlockUserData::findPreviousOpenParenthesis(QTextCursor *cursor, bool select, bool onlyInCurrentBlock)
|
||||
{
|
||||
QTextBlock block = cursor->block();
|
||||
int position = cursor->position();
|
||||
@@ -224,6 +224,8 @@ bool TextBlockUserData::findPreviousOpenParenthesis(QTextCursor *cursor, bool se
|
||||
}
|
||||
}
|
||||
}
|
||||
if (onlyInCurrentBlock)
|
||||
return false;
|
||||
block = block.previous();
|
||||
}
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user