From b64bf8ca69c473de973eddef3d137fea80acb968 Mon Sep 17 00:00:00 2001
From: Akseli Lahtinen <akselmo@akselmo.dev>
Date: Thu, 24 Apr 2025 16:45:58 +0300
Subject: [PATCH] DolphinView: Don't end anchored selection in
 updateSelectionState

Do not end anchored selection when selection state is updated, such as
when Dolphin is started with --select "thing.txt" flag.

If we end here, and user wants to press shift to select from
current item to X items, this would cause the anchored selection
to start from the clicked item, not from the first selected item.

BUG: 503221
---
 src/views/dolphinview.cpp | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp
index f3bde88df2..ee7ac51d26 100644
--- a/src/views/dolphinview.cpp
+++ b/src/views/dolphinview.cpp
@@ -1776,7 +1776,6 @@ void DolphinView::updateSelectionState()
             if (!selectedItems.isEmpty()) {
                 selectionManager->beginAnchoredSelection(selectionManager->currentItem());
                 selectionManager->setSelectedItems(selectedItems);
-                selectionManager->endAnchoredSelection();
                 if (shouldScrollToCurrentItem) {
                     m_view->scrollToItem(selectedItems.first());
                 }
-- 
GitLab

