diff options
author | Aram Drevekenin <aram@poor.dev> | 2022-03-24 17:19:09 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-24 17:19:09 +0100 |
commit | 509f2360230a8e08311b869726df3b77a5dca51e (patch) | |
tree | 219e87aa74af4a5a685dd1019de74b14757e1d28 /zellij-server/src/tab | |
parent | c53b3235c848bbf1c6f56e4c00f46e99b47f9cd6 (diff) |
fix(tab): do not crash when only floating panes are left (#1266)
Diffstat (limited to 'zellij-server/src/tab')
-rw-r--r-- | zellij-server/src/tab/mod.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/zellij-server/src/tab/mod.rs b/zellij-server/src/tab/mod.rs index f8d061649..22e4ef644 100644 --- a/zellij-server/src/tab/mod.rs +++ b/zellij-server/src/tab/mod.rs @@ -1035,6 +1035,10 @@ impl Tab { .filter(|(_, p)| p.selectable()); selectable_tiled_panes.count() > 0 || selectable_floating_panes.count() > 0 } + pub fn has_selectable_tiled_panes(&self) -> bool { + let selectable_tiled_panes = self.tiled_panes.get_panes().filter(|(_, p)| p.selectable()); + selectable_tiled_panes.count() > 0 + } pub fn resize_whole_tab(&mut self, new_screen_size: Size) { self.floating_panes.resize(new_screen_size); self.tiled_panes.resize(new_screen_size); |