diff options
| author | Vasileios Manolopoulos <44965914+VasilisManol@users.noreply.github.com> | 2024-10-25 15:18:29 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-25 15:18:29 +0200 |
| commit | 9a2f90936b5bcdd707a4bcdcf433dec61a13ff13 (patch) | |
| tree | 0481cc2bf5e40f6b05e34de1be14dbd526b6520d | |
| parent | style(fmt): remove warnings (#3701) (diff) | |
| download | sl0ppij-9a2f90936b5bcdd707a4bcdcf433dec61a13ff13.tar.gz sl0ppij-9a2f90936b5bcdd707a4bcdcf433dec61a13ff13.tar.xz sl0ppij-9a2f90936b5bcdd707a4bcdcf433dec61a13ff13.zip | |
fix: (tabs) move to next tab if moving to next pane from fullscreen pane (#3498)
Co-authored-by: Vasilis Manolopoulos <vmanolop@gmail.comh>
| -rw-r--r-- | zellij-server/src/panes/tiled_panes/mod.rs | 10 | ||||
| -rw-r--r-- | 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 9e640732..0e578b3b 100644 --- a/zellij-server/src/panes/tiled_panes/mod.rs +++ b/zellij-server/src/panes/tiled_panes/mod.rs @@ -1691,16 +1691,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 ceea0432..d69a23cb 100644 --- a/zellij-server/src/tab/mod.rs +++ b/zellij-server/src/tab/mod.rs @@ -2052,19 +2052,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() { @@ -2401,8 +2401,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)) } @@ -2468,8 +2467,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)) } |
