Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: (tabs) move to next tab if moving to next pane from fullscreen pane #3498

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -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) {
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 @@ -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() {
Expand Down Expand Up @@ -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))
}
Expand Down Expand Up @@ -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))
}
Expand Down