diff options
| author | Denis Maximov <denismaximov98@gmail.com> | 2021-02-25 09:45:23 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-02-25 09:45:23 +0200 |
| commit | f9441bce99a80b95204ea2016481c24cee909d51 (patch) | |
| tree | 0fd91434af3477f9b7c16a61b822537a18abcca2 /src/common/input | |
| parent | Make fullscreen panes not override the status bar and strider (#209) (diff) | |
| parent | add basic tab bar #166 (diff) | |
| download | sl0ppij-f9441bce99a80b95204ea2016481c24cee909d51.tar.gz sl0ppij-f9441bce99a80b95204ea2016481c24cee909d51.tar.xz sl0ppij-f9441bce99a80b95204ea2016481c24cee909d51.zip | |
Merge pull request #204 from jcaplan/tab-bar-166
add tab toolbar
Diffstat (limited to 'src/common/input')
| -rw-r--r-- | src/common/input/actions.rs | 1 | ||||
| -rw-r--r-- | src/common/input/handler.rs | 5 | ||||
| -rw-r--r-- | src/common/input/keybinds.rs | 3 |
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 => { |
