diff options
| author | a-kenji <aks.kenji@protonmail.com> | 2021-05-10 17:24:19 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-05-10 17:24:19 +0200 |
| commit | e2514b411cf168aa970a558c66ee0cb937c0a30c (patch) | |
| tree | 2dbf111fd1dcdc62d91c3c2eba0b38fa02b9ba39 /src/common/screen.rs | |
| parent | Fix exit code on `dump-default-config` (diff) | |
| parent | docs(changelog): Switch tabs in normal mode #471 (diff) | |
| download | sl0ppij-e2514b411cf168aa970a558c66ee0cb937c0a30c.tar.gz sl0ppij-e2514b411cf168aa970a558c66ee0cb937c0a30c.tar.xz sl0ppij-e2514b411cf168aa970a558c66ee0cb937c0a30c.zip | |
Merge branch 'main' into dump-config-exit
Diffstat (limited to 'src/common/screen.rs')
| -rw-r--r-- | src/common/screen.rs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/common/screen.rs b/src/common/screen.rs index b12578a7..44cfe3ba 100644 --- a/src/common/screen.rs +++ b/src/common/screen.rs @@ -33,9 +33,11 @@ pub enum ScreenInstruction { FocusNextPane, FocusPreviousPane, MoveFocusLeft, + MoveFocusLeftOrPreviousTab, MoveFocusDown, MoveFocusUp, MoveFocusRight, + MoveFocusRightOrNextTab, Exit, ScrollUp, ScrollDown, @@ -422,12 +424,32 @@ pub fn screen_thread_main( ScreenInstruction::MoveFocusLeft => { screen.get_active_tab_mut().unwrap().move_focus_left(); } + ScreenInstruction::MoveFocusLeftOrPreviousTab => { + if !screen.get_active_tab_mut().unwrap().move_focus_left() { + screen.switch_tab_prev(); + } + screen + .bus + .senders + .send_to_server(ServerInstruction::UnblockInputThread) + .unwrap(); + } ScreenInstruction::MoveFocusDown => { screen.get_active_tab_mut().unwrap().move_focus_down(); } ScreenInstruction::MoveFocusRight => { screen.get_active_tab_mut().unwrap().move_focus_right(); } + ScreenInstruction::MoveFocusRightOrNextTab => { + if !screen.get_active_tab_mut().unwrap().move_focus_right() { + screen.switch_tab_next(); + } + screen + .bus + .senders + .send_to_server(ServerInstruction::UnblockInputThread) + .unwrap(); + } ScreenInstruction::MoveFocusUp => { screen.get_active_tab_mut().unwrap().move_focus_up(); } |
