From 843997a0d89385200d8ef0c4551d2801a676fe9c Mon Sep 17 00:00:00 2001 From: Josh Megnauth Date: Tue, 6 Feb 2024 03:14:12 -0500 Subject: [PATCH] Add Alt-Left and Alt-Right for history navigation Common shortcuts. --- src/app.rs | 4 ++++ src/key_bind.rs | 2 ++ 2 files changed, 6 insertions(+) diff --git a/src/app.rs b/src/app.rs index f323d73..b77fe13 100644 --- a/src/app.rs +++ b/src/app.rs @@ -44,6 +44,8 @@ pub struct Flags { pub enum Action { Copy, Cut, + HistoryNext, + HistoryPrevious, MoveToTrash, NewFile, NewFolder, @@ -67,6 +69,8 @@ impl Action { match self { Action::Copy => Message::Copy(entity_opt), Action::Cut => Message::Cut(entity_opt), + Action::HistoryNext => Message::TabMessage(None, tab::Message::GoNext), + Action::HistoryPrevious => Message::TabMessage(None, tab::Message::GoPrevious), Action::MoveToTrash => Message::MoveToTrash(entity_opt), Action::NewFile => Message::NewFile(entity_opt), Action::NewFolder => Message::NewFolder(entity_opt), diff --git a/src/key_bind.rs b/src/key_bind.rs index a8c3cce..f1a33b1 100644 --- a/src/key_bind.rs +++ b/src/key_bind.rs @@ -55,6 +55,8 @@ pub fn key_binds() -> HashMap { bind!([Ctrl], C, Copy); bind!([Ctrl], X, Cut); + bind!([Alt], Right, HistoryNext); + bind!([Alt], Left, HistoryPrevious); bind!([Ctrl], V, Paste); bind!([Ctrl], A, SelectAll); bind!([Ctrl], W, TabClose);