aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/screen.rs
diff options
context:
space:
mode:
authora-kenji <aks.kenji@protonmail.com>2021-05-10 17:24:19 +0200
committerGitHub <noreply@github.com>2021-05-10 17:24:19 +0200
commite2514b411cf168aa970a558c66ee0cb937c0a30c (patch)
tree2dbf111fd1dcdc62d91c3c2eba0b38fa02b9ba39 /src/common/screen.rs
parentFix exit code on `dump-default-config` (diff)
parentdocs(changelog): Switch tabs in normal mode #471 (diff)
downloadsl0ppij-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.rs22
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();
}