From 1beb1e8f68865f430f492a4eeb6f8b366164ad7a Mon Sep 17 00:00:00 2001 From: Vasilis Manolopoulos Date: Sun, 14 Jul 2024 00:27:00 +0200 Subject: [PATCH] fix: (tabs) move to next tab if moving to next pane from fullscreen pane --- zellij-server/src/panes/tiled_panes/mod.rs | 10 ++++++---- zellij-server/src/tab/mod.rs | 18 ++++++++---------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/zellij-server/src/panes/tiled_panes/mod.rs b/zellij-server/src/panes/tiled_panes/mod.rs index 9c2458c2c8..abf324e460 100644 --- a/zellij-server/src/panes/tiled_panes/mod.rs +++ b/zellij-server/src/panes/tiled_panes/mod.rs @@ -1665,16 +1665,18 @@ impl TiledPanes { } } - pub fn focus_pane_left_fullscreen(&mut self, client_id: ClientId) { + pub fn focus_pane_left_fullscreen(&mut self, client_id: ClientId) -> bool { self.unset_fullscreen(); - self.move_focus_left(client_id); + let ret = self.move_focus_left(client_id); self.toggle_active_pane_fullscreen(client_id); + return ret; } - pub fn focus_pane_right_fullscreen(&mut self, client_id: ClientId) { + pub fn focus_pane_right_fullscreen(&mut self, client_id: ClientId) -> bool { self.unset_fullscreen(); - self.move_focus_right(client_id); + let ret = self.move_focus_right(client_id); self.toggle_active_pane_fullscreen(client_id); + return ret; } pub fn focus_pane_up_fullscreen(&mut self, client_id: ClientId) { diff --git a/zellij-server/src/tab/mod.rs b/zellij-server/src/tab/mod.rs index 92e9eeb949..2daeebde0f 100644 --- a/zellij-server/src/tab/mod.rs +++ b/zellij-server/src/tab/mod.rs @@ -1919,19 +1919,19 @@ impl Tab { pub fn are_floating_panes_visible(&self) -> bool { self.floating_panes.panes_are_visible() } - pub fn focus_pane_left_fullscreen(&mut self, client_id: ClientId) { + pub fn focus_pane_left_fullscreen(&mut self, client_id: ClientId) -> bool { if !self.is_fullscreen_active() { - return; + return false; } - self.tiled_panes.focus_pane_left_fullscreen(client_id); + return self.tiled_panes.focus_pane_left_fullscreen(client_id); } - pub fn focus_pane_right_fullscreen(&mut self, client_id: ClientId) { + pub fn focus_pane_right_fullscreen(&mut self, client_id: ClientId) -> bool { if !self.is_fullscreen_active() { - return; + return false; } - self.tiled_panes.focus_pane_right_fullscreen(client_id); + return self.tiled_panes.focus_pane_right_fullscreen(client_id); } pub fn focus_pane_up_fullscreen(&mut self, client_id: ClientId) { if !self.is_fullscreen_active() { @@ -2267,8 +2267,7 @@ impl Tab { return Ok(false); } if self.tiled_panes.fullscreen_is_active() { - self.focus_pane_left_fullscreen(client_id); - return Ok(true); + return Ok(self.focus_pane_left_fullscreen(client_id)); } Ok(self.tiled_panes.move_focus_left(client_id)) } @@ -2334,8 +2333,7 @@ impl Tab { return Ok(false); } if self.tiled_panes.fullscreen_is_active() { - self.focus_pane_right_fullscreen(client_id); - return Ok(true); + return Ok(self.focus_pane_right_fullscreen(client_id)); } Ok(self.tiled_panes.move_focus_right(client_id)) }