summaryrefslogtreecommitdiffstats
path: root/zellij-server/src/tab
diff options
context:
space:
mode:
authorAram Drevekenin <aram@poor.dev>2022-11-23 18:14:24 +0100
committerGitHub <noreply@github.com>2022-11-23 18:14:24 +0100
commitf8fbd8a138f46db4a02084a98bb182f625faea4a (patch)
tree8d7faee691d1691e786827f3803947b8c7fdfbc9 /zellij-server/src/tab
parent00fedafa38daca7a463d3d1b8b29fd74d47327c8 (diff)
fix(panes): focus change when closing and between tabs (#1966)
* fix(panes): do not forget pane focus when switching tabs or closing panes * style(fmt): rustfmt * fix(tests): e2e snapshots
Diffstat (limited to 'zellij-server/src/tab')
-rw-r--r--zellij-server/src/tab/mod.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/zellij-server/src/tab/mod.rs b/zellij-server/src/tab/mod.rs
index e98b46143..45200f7c6 100644
--- a/zellij-server/src/tab/mod.rs
+++ b/zellij-server/src/tab/mod.rs
@@ -681,11 +681,11 @@ impl Tab {
self.floating_panes.first_active_floating_pane_id()
{
self.floating_panes
- .focus_pane(first_active_floating_pane_id, client_id);
+ .focus_pane_if_client_not_focused(first_active_floating_pane_id, client_id);
}
if let Some(first_active_tiled_pane_id) = self.tiled_panes.first_active_pane_id() {
self.tiled_panes
- .focus_pane(first_active_tiled_pane_id, client_id);
+ .focus_pane_if_client_not_focused(first_active_tiled_pane_id, client_id);
}
self.connected_clients.borrow_mut().insert(client_id);
self.mode_info.borrow_mut().insert(
@@ -707,7 +707,8 @@ impl Tab {
format!("failed to acquire id of focused pane while adding client {client_id}",)
})?)
};
- self.tiled_panes.focus_pane(focus_pane_id, client_id);
+ self.tiled_panes
+ .focus_pane_if_client_not_focused(focus_pane_id, client_id);
self.connected_clients.borrow_mut().insert(client_id);
self.mode_info.borrow_mut().insert(
client_id,