aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/input
diff options
context:
space:
mode:
authorJonah Caplan <jonahcaplan@gmail.com>2021-02-20 18:19:05 -0500
committerJonah Caplan <jonahcaplan@gmail.com>2021-02-25 01:44:10 -0500
commitce54127d7de314e683ed0fefd8be987bbc47e369 (patch)
tree0fd91434af3477f9b7c16a61b822537a18abcca2 /src/common/input
parentMake fullscreen panes not override the status bar and strider (#209) (diff)
downloadsl0ppij-ce54127d7de314e683ed0fefd8be987bbc47e369.tar.gz
sl0ppij-ce54127d7de314e683ed0fefd8be987bbc47e369.tar.xz
sl0ppij-ce54127d7de314e683ed0fefd8be987bbc47e369.zip
add basic tab bar #166
Diffstat (limited to 'src/common/input')
-rw-r--r--src/common/input/actions.rs1
-rw-r--r--src/common/input/handler.rs5
-rw-r--r--src/common/input/keybinds.rs3
3 files changed, 9 insertions, 0 deletions
diff --git a/src/common/input/actions.rs b/src/common/input/actions.rs
index eee8b1b6..fe5e2dad 100644
--- a/src/common/input/actions.rs
+++ b/src/common/input/actions.rs
@@ -47,4 +47,5 @@ pub enum Action {
GoToPreviousTab,
/// Close the current tab.
CloseTab,
+ GoToTab(u32),
}
diff --git a/src/common/input/handler.rs b/src/common/input/handler.rs
index 2a8c3bfa..5c4f1971 100644
--- a/src/common/input/handler.rs
+++ b/src/common/input/handler.rs
@@ -227,6 +227,11 @@ impl InputHandler {
.unwrap();
self.command_is_executing.wait_until_pane_is_closed();
}
+ Action::GoToTab(i) => {
+ self.send_screen_instructions
+ .send(ScreenInstruction::GoToTab(i))
+ .unwrap();
+ }
Action::NoOp => {}
}
diff --git a/src/common/input/keybinds.rs b/src/common/input/keybinds.rs
index c573a557..e56488b4 100644
--- a/src/common/input/keybinds.rs
+++ b/src/common/input/keybinds.rs
@@ -133,6 +133,9 @@ fn get_defaults_for_mode(mode: &InputMode) -> Result<ModeKeybinds, String> {
Key::Ctrl('g'),
vec![Action::SwitchToMode(InputMode::Normal)],
);
+ for i in '1'..='9' {
+ defaults.insert(Key::Char(i), vec![Action::GoToTab(i.to_digit(10).unwrap())]);
+ }
defaults.insert(Key::Esc, vec![Action::SwitchToMode(InputMode::Command)]);
}
InputMode::Scroll => {