diff options
| author | Aram Drevekenin <aram@poor.dev> | 2021-06-30 11:27:35 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-06-30 11:27:35 +0200 |
| commit | ed4fd2a8e77df304539ca7f445a78039028eaa8a (patch) | |
| tree | ae48b03370b11f3f0987676584724463ac83460d /zellij-server/src/screen.rs | |
| parent | Merge pull request #590 from a-kenji/clippy-fixes (diff) | |
| download | sl0ppij-ed4fd2a8e77df304539ca7f445a78039028eaa8a.tar.gz sl0ppij-ed4fd2a8e77df304539ca7f445a78039028eaa8a.tar.xz sl0ppij-ed4fd2a8e77df304539ca7f445a78039028eaa8a.zip | |
chore(tests): move all integration tests to be either unit or e2e tests - remove old testing infra (#589)
* tests(integration): move basic integration tests to be unit tests
* fix(tests): silently fail threadbus for tests
* tests(unit): move compatibility tests to become unit tests for grid
* tests(unit): move close_pane tests to become unit tests for grid
* tests(e2e): move basic layout test to e2e
* tests(unit): move move_focus tests to be unit tests
* tests(unit): move resize_down tests to be unit tests
* tests(unit): move resize_left tests to be unit tests
* tests(unit): move resize_right tests to be unit tests
* tests(unit): move resize_up tests to be unit tests
* tests(infra): remove unused infra
* style(fmt): make rustfmt happy
* debug
* debug
* debug
* debug
* chore(test): shift volume mounting around because github actions is a special child
Diffstat (limited to 'zellij-server/src/screen.rs')
| -rw-r--r-- | zellij-server/src/screen.rs | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/zellij-server/src/screen.rs b/zellij-server/src/screen.rs index 009a3a92..88fb7848 100644 --- a/zellij-server/src/screen.rs +++ b/zellij-server/src/screen.rs @@ -393,6 +393,16 @@ impl Screen { tab.mode_info = self.mode_info.clone(); } } + pub fn move_focus_left_or_previous_tab(&mut self) { + if !self.get_active_tab_mut().unwrap().move_focus_left() { + self.switch_tab_prev(); + } + } + pub fn move_focus_right_or_next_tab(&mut self) { + if !self.get_active_tab_mut().unwrap().move_focus_right() { + self.switch_tab_next(); + } + } } // The box is here in order to make the @@ -507,9 +517,7 @@ pub(crate) fn screen_thread_main( 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.move_focus_left_or_previous_tab(); screen .bus .senders @@ -523,9 +531,7 @@ pub(crate) fn screen_thread_main( 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.move_focus_right_or_next_tab(); screen .bus .senders @@ -674,3 +680,7 @@ pub(crate) fn screen_thread_main( } } } + +#[cfg(test)] +#[path = "./unit/screen_tests.rs"] +mod screen_tests; |
