From 3b31919427baf3da1ab1a24f682a4cefc7e5106f Mon Sep 17 00:00:00 2001 From: Christoph Cullmann Date: Sun, 16 Jan 2022 18:29:57 +0100 Subject: [PATCH] Revert "Do not cancel mouse selection when using the keyboard" This reverts commit 5dce70a9693f8cce37f733b4687bb9b303376742. => this leads to regressions if somebody has time to properly reproduce and fix that, we can reapply this, otherwise it is better to have some always working state without this small usability improvement BUG: 447525 BUG: 446189 frameworks/ktexteditor#11 --- src/view/kateview.cpp | 20 ++++++++++---------- src/view/kateviewinternal.cpp | 5 ----- src/view/kateviewinternal.h | 2 -- 3 files changed, 10 insertions(+), 17 deletions(-) diff --git a/src/view/kateview.cpp b/src/view/kateview.cpp index 6b88eb75..56348480 100644 --- a/src/view/kateview.cpp +++ b/src/view/kateview.cpp @@ -3063,9 +3063,9 @@ void KTextEditor::ViewPrivate::shiftCursorRight() void KTextEditor::ViewPrivate::wordLeft() { if (currentTextLine().isRightToLeft()) { - m_viewInternal->wordNext(m_viewInternal->isUserSelecting()); + m_viewInternal->wordNext(); } else { - m_viewInternal->wordPrev(m_viewInternal->isUserSelecting()); + m_viewInternal->wordPrev(); } } @@ -3081,9 +3081,9 @@ void KTextEditor::ViewPrivate::shiftWordLeft() void KTextEditor::ViewPrivate::wordRight() { if (currentTextLine().isRightToLeft()) { - m_viewInternal->wordPrev(m_viewInternal->isUserSelecting()); + m_viewInternal->wordPrev(); } else { - m_viewInternal->wordNext(m_viewInternal->isUserSelecting()); + m_viewInternal->wordNext(); } } @@ -3098,7 +3098,7 @@ void KTextEditor::ViewPrivate::shiftWordRight() void KTextEditor::ViewPrivate::home() { - m_viewInternal->home(m_viewInternal->isUserSelecting()); + m_viewInternal->home(); } void KTextEditor::ViewPrivate::shiftHome() @@ -3108,7 +3108,7 @@ void KTextEditor::ViewPrivate::shiftHome() void KTextEditor::ViewPrivate::end() { - m_viewInternal->end(m_viewInternal->isUserSelecting()); + m_viewInternal->end(); } void KTextEditor::ViewPrivate::shiftEnd() @@ -3118,7 +3118,7 @@ void KTextEditor::ViewPrivate::shiftEnd() void KTextEditor::ViewPrivate::up() { - m_viewInternal->cursorUp(m_viewInternal->isUserSelecting()); + m_viewInternal->cursorUp(); } void KTextEditor::ViewPrivate::shiftUp() @@ -3128,7 +3128,7 @@ void KTextEditor::ViewPrivate::shiftUp() void KTextEditor::ViewPrivate::down() { - m_viewInternal->cursorDown(m_viewInternal->isUserSelecting()); + m_viewInternal->cursorDown(); } void KTextEditor::ViewPrivate::shiftDown() @@ -3168,7 +3168,7 @@ void KTextEditor::ViewPrivate::shiftBottomOfView() void KTextEditor::ViewPrivate::pageUp() { - m_viewInternal->pageUp(m_viewInternal->isUserSelecting()); + m_viewInternal->pageUp(); } void KTextEditor::ViewPrivate::shiftPageUp() @@ -3178,7 +3178,7 @@ void KTextEditor::ViewPrivate::shiftPageUp() void KTextEditor::ViewPrivate::pageDown() { - m_viewInternal->pageDown(m_viewInternal->isUserSelecting()); + m_viewInternal->pageDown(); } void KTextEditor::ViewPrivate::shiftPageDown() diff --git a/src/view/kateviewinternal.cpp b/src/view/kateviewinternal.cpp index d642938a..c8d479d6 100644 --- a/src/view/kateviewinternal.cpp +++ b/src/view/kateviewinternal.cpp @@ -4077,11 +4077,6 @@ void KateViewInternal::viewSelectionChanged() m_selectionCached.setStart(KTextEditor::Cursor::invalid()); } -bool KateViewInternal::isUserSelecting() const -{ - return m_selChangedByUser; -} - KateLayoutCache *KateViewInternal::cache() const { return m_layoutCache; diff --git a/src/view/kateviewinternal.h b/src/view/kateviewinternal.h index 66b137b6..8639dcef 100644 --- a/src/view/kateviewinternal.h +++ b/src/view/kateviewinternal.h @@ -228,8 +228,6 @@ public: return m_leftBorder; } - bool isUserSelecting() const; - // EVENT HANDLING STUFF - IMPORTANT private: void fixDropEvent(QDropEvent *event); -- GitLab