Skip to content

A fast file manager for Windows and macOS that never freezes: tabs, dual panes, archives as folders, Quick Look-style previews. A File Explorer and Finder alternative written in Rust.

Shift+Left and Shift+Right extend the selection in the grid layouts (908)

denfryf53f5874b3eb
diff --git a/crates/rf-app/src/actions.rs b/crates/rf-app/src/actions.rs
index 63618c37..281ba8cf 100644
--- a/crates/rf-app/src/actions.rs
+++ b/crates/rf-app/src/actions.rs
@@ -69,6 +69,8 @@ gpui_kit::actions!(
OpenWith,
SelectLeft,
SelectRight,
+ ExtendLeft,
+ ExtendRight,
ViewDetails,
ViewGrid,
TogglePreview,
@@ -238,6 +240,9 @@ pub fn bind(cx: &mut App) {
KeyBinding::new("ctrl-shift-c", CopyPath, f),
KeyBinding::new("left", SelectLeft, f),
KeyBinding::new("right", SelectRight, f),
+ // (the selection grows sideways in the grid, as Shift+Up / Down grow it by a row: issue 908)
+ KeyBinding::new("shift-left", ExtendLeft, f),
+ KeyBinding::new("shift-right", ExtendRight, f),
KeyBinding::new("ctrl-shift-1", ViewDetails, None),
KeyBinding::new("ctrl-shift-2", ViewGrid, None),
KeyBinding::new("ctrl-shift-3", ViewColumns, None),
diff --git a/crates/rf-app/src/folder_view.rs b/crates/rf-app/src/folder_view.rs
index 6179d028..d4e1fa05 100644
--- a/crates/rf-app/src/folder_view.rs
+++ b/crates/rf-app/src/folder_view.rs
@@ -8230,6 +8230,16 @@ impl Render for FolderView {
}
ViewMode::Details => {}
}))
+ .on_action(cx.listener(|this, _: &ExtendLeft, _, cx| {
+ if this.renaming.is_none() && this.view_mode == ViewMode::Grid {
+ this.move_cursor(-this.side_step(), true, cx);
+ }
+ }))
+ .on_action(cx.listener(|this, _: &ExtendRight, _, cx| {
+ if this.renaming.is_none() && this.view_mode == ViewMode::Grid {
+ this.move_cursor(this.side_step(), true, cx);
+ }
+ }))
.on_action(cx.listener(|this, _: &PageDown, _, cx| this.move_cursor(PAGE_STEP, false, cx)))
.on_action(cx.listener(|this, _: &PageUp, _, cx| this.move_cursor(-PAGE_STEP, false, cx)))
.on_action(cx.listener(|this, _: &ExtendPageDown, _, cx| this.move_cursor(PAGE_STEP, true, cx)))