Skip to content

Commit 4de1e66

Browse files
DeskTop: Left/Right Arrow in list views shouldn't clear selection
Regression from v1.5 - since Left Arrow/Right Arrow keys don't do change the selection in list views, they shouldn't change selection at all. But if selection was in another window it would be cleared. The fix is simply to move a block of code up, which eliminates a redundant call as well.
1 parent 7d3c09f commit 4de1e66

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/desktop/main.s

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3773,8 +3773,6 @@ END_PARAM_BLOCK
37733773
ENTRY_POINTS_FOR_A left, kDirLeft, right, kDirRight, up, kDirUp, down, kDirDown
37743774
sta dir
37753775

3776-
jsr CacheFocusedWindowIconList
3777-
37783776
;;; --------------------------------------------------
37793777
;;; If a list view, use index-based logic
37803778

@@ -3790,6 +3788,8 @@ END_PARAM_BLOCK
37903788
;;; --------------------------------------------------
37913789
;;; Identify a starting icon
37923790

3791+
jsr CacheFocusedWindowIconList
3792+
37933793
lda selected_icon_count
37943794
jeq fallback
37953795
cmp cached_window_icon_count

tests/desktop/keyboard.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -814,9 +814,7 @@ test.Variants(
814814
a2d.InvokeMenuItem(a2d.VIEW_MENU, a2d.VIEW_BY_NAME)
815815
a2d.WaitForRepaint()
816816

817-
-- TODO: Fails without this, as selection is on the volume.
818-
-- Is this correct or not?
819-
a2d.ClearSelection()
817+
test.ExpectEqualsIgnoreCase(a2dtest.GetSelectedIconName(), "A2.DESKTOP", "single volume should be selected")
820818

821819
a2dtest.ExpectNothingChanged(function()
822820
if idx == 1 then
@@ -826,6 +824,8 @@ test.Variants(
826824
end
827825
a2d.WaitForRepaint()
828826
end)
827+
828+
test.ExpectEqualsIgnoreCase(a2dtest.GetSelectedIconName(), "A2.DESKTOP", "single volume should be selected")
829829
end)
830830

831831
--[[

0 commit comments

Comments
 (0)