forked from qt-creator/qt-creator
Utils: make select at column 0-based
Change-Id: I514611cbd887eec6e46c80e5a2964c04ad05fdf2 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -139,10 +139,10 @@ QTextCursor selectAt(QTextCursor textCursor, int line, int column, uint length)
|
||||
if (line < 1)
|
||||
line = 1;
|
||||
|
||||
if (column < 1)
|
||||
column = 1;
|
||||
if (column < 0)
|
||||
column = 0;
|
||||
|
||||
const int anchorPosition = positionInText(textCursor.document(), line, column);
|
||||
const int anchorPosition = positionInText(textCursor.document(), line, column + 1);
|
||||
textCursor.setPosition(anchorPosition);
|
||||
textCursor.setPosition(anchorPosition + int(length), QTextCursor::KeepAnchor);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user