forked from qt-creator/qt-creator
Utils: swap anchor and position of Utils::Text::selectAt
selecting now from column to column+length Change-Id: I34fdf2d3db7fb15687b973094b2ca063b5c6587c Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -88,9 +88,9 @@ QTextCursor selectAt(QTextCursor textCursor, int line, int column, uint length)
|
||||
if (column < 1)
|
||||
column = 1;
|
||||
|
||||
const int anchorPosition = positionInText(textCursor.document(), line, column + length);
|
||||
const int anchorPosition = positionInText(textCursor.document(), line, column);
|
||||
textCursor.setPosition(anchorPosition);
|
||||
textCursor.setPosition(anchorPosition - length, QTextCursor::KeepAnchor);
|
||||
textCursor.setPosition(anchorPosition + int(length), QTextCursor::KeepAnchor);
|
||||
|
||||
return textCursor;
|
||||
}
|
||||
|
Reference in New Issue
Block a user