Skip to content

Commit

Permalink
fix: (tabs) move to next tab if moving to next pane from fullscreen p…
Browse files Browse the repository at this point in the history
…ane (zellij-org#3498)

Co-authored-by: Vasilis Manolopoulos <vmanolop@gmail.comh>
  • Loading branch information
2 people authored and Tomcat-42 committed Nov 9, 2024
1 parent 8320257 commit 4f07e5c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
10 changes: 6 additions & 4 deletions zellij-server/src/panes/tiled_panes/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
18 changes: 8 additions & 10 deletions zellij-server/src/tab/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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))
}
Expand Down Expand Up @@ -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))
}
Expand Down

0 comments on commit 4f07e5c

Please sign in to comment.