aboutsummaryrefslogtreecommitdiffstats
path: root/zellij-server/src/panes/tiled_panes
diff options
context:
space:
mode:
authorAram Drevekenin <aram@poor.dev>2024-10-11 18:04:18 +0200
committerGitHub <noreply@github.com>2024-10-11 18:04:18 +0200
commit2bd0f2a535433c99ef7f131a0d3b4b2046235c91 (patch)
treea09456d13650451e58a5464cae993f6b259053aa /zellij-server/src/panes/tiled_panes
parentdocs(changelog): concurrent http plugin downloads (diff)
downloadsl0ppij-2bd0f2a535433c99ef7f131a0d3b4b2046235c91.tar.gz
sl0ppij-2bd0f2a535433c99ef7f131a0d3b4b2046235c91.tar.xz
sl0ppij-2bd0f2a535433c99ef7f131a0d3b4b2046235c91.zip
fix(plugins): various plugin api and other fixes (#3665)
* fix(plugins): do not allow focusing an unselectable pane * fix(folders): make sure config and cache folders exist on app start
Diffstat (limited to 'zellij-server/src/panes/tiled_panes')
-rw-r--r--zellij-server/src/panes/tiled_panes/mod.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/zellij-server/src/panes/tiled_panes/mod.rs b/zellij-server/src/panes/tiled_panes/mod.rs
index 931e2594..fba9ea21 100644
--- a/zellij-server/src/panes/tiled_panes/mod.rs
+++ b/zellij-server/src/panes/tiled_panes/mod.rs
@@ -524,6 +524,15 @@ impl TiledPanes {
}
}
pub fn focus_pane(&mut self, pane_id: PaneId, client_id: ClientId) {
+ let pane_is_selectable = self
+ .panes
+ .get(&pane_id)
+ .map(|p| p.selectable())
+ .unwrap_or(false);
+ if !pane_is_selectable {
+ log::error!("Cannot focus pane {:?} as it is not selectable!", pane_id);
+ return;
+ }
if self.panes_to_hide.contains(&pane_id) {
// this means there is a fullscreen pane that is not the current pane, let's unset it
// before changing focus