forked from qt-creator/qt-creator
Pressing cursor keys did not clear selection
Creator got a feature that pressing cursor keys without effect did not clear the selection. E.g. Left at position 0, or End at the end of a block. This was not in sync with other editors. Pressing the cursor keys without selection modifier should ALWAYS clear the selection. Task-number: QTCREATORBUG-3327
This commit is contained in:
@@ -1469,21 +1469,18 @@ bool BaseTextEditor::cursorMoveKeyEvent(QKeyEvent *e)
|
||||
|
||||
bool visualNavigation = cursor.visualNavigation();
|
||||
cursor.setVisualNavigation(true);
|
||||
bool moved = false;
|
||||
|
||||
if (op == QTextCursor::WordRight) {
|
||||
moved = camelCaseRight(cursor, mode);
|
||||
camelCaseRight(cursor, mode);
|
||||
} else if (op == QTextCursor::WordLeft) {
|
||||
moved = camelCaseLeft(cursor, mode);
|
||||
camelCaseLeft(cursor, mode);
|
||||
} else {
|
||||
moved = cursor.movePosition(op, mode);
|
||||
cursor.movePosition(op, mode);
|
||||
}
|
||||
cursor.setVisualNavigation(visualNavigation);
|
||||
|
||||
if (moved) {
|
||||
setTextCursor(cursor);
|
||||
ensureCursorVisible();
|
||||
}
|
||||
setTextCursor(cursor);
|
||||
ensureCursorVisible();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user