From 748920e8fdd0d63b3023dbe1197408487637c1b7 Mon Sep 17 00:00:00 2001 From: fourtf Date: Mon, 26 Aug 2019 11:11:02 +0200 Subject: [PATCH] fixed shift+(home/end) --- src/widgets/splits/SplitInput.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/widgets/splits/SplitInput.cpp b/src/widgets/splits/SplitInput.cpp index 1b31af989..a1f132d58 100644 --- a/src/widgets/splits/SplitInput.cpp +++ b/src/widgets/splits/SplitInput.cpp @@ -255,7 +255,11 @@ void SplitInput::installKeyPressedEvent() else if (event->key() == Qt::Key_Home) { QTextCursor cursor = this->ui_.textEdit->textCursor(); - cursor.movePosition(QTextCursor::Start); + cursor.movePosition( + QTextCursor::Start, + event->modifiers() & Qt::KeyboardModifier::ShiftModifier + ? QTextCursor::MoveMode::KeepAnchor + : QTextCursor::MoveMode::MoveAnchor); this->ui_.textEdit->setTextCursor(cursor); event->accept(); @@ -263,7 +267,11 @@ void SplitInput::installKeyPressedEvent() else if (event->key() == Qt::Key_End) { QTextCursor cursor = this->ui_.textEdit->textCursor(); - cursor.movePosition(QTextCursor::End); + cursor.movePosition( + QTextCursor::End, + event->modifiers() & Qt::KeyboardModifier::ShiftModifier + ? QTextCursor::MoveMode::KeepAnchor + : QTextCursor::MoveMode::MoveAnchor); this->ui_.textEdit->setTextCursor(cursor); event->accept();