summaryrefslogtreecommitdiffstats
path: root/zellij-utils
diff options
context:
space:
mode:
authorAram Drevekenin <aram@poor.dev>2023-03-30 18:04:47 +0200
committerGitHub <noreply@github.com>2023-03-30 18:04:47 +0200
commit30374d4ede2e170734c2ccb6fc2641e4f686b9de (patch)
tree4d19be33bca7a3cddd377dbe63dd8f331f49c7e5 /zellij-utils
parent55a2f4915e56970d26008fbea7b205f52be0ef85 (diff)
fix(layouts): nested attribute truncating (#2337)
Diffstat (limited to 'zellij-utils')
-rw-r--r--zellij-utils/src/input/layout.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/zellij-utils/src/input/layout.rs b/zellij-utils/src/input/layout.rs
index d06833416..78db7ce51 100644
--- a/zellij-utils/src/input/layout.rs
+++ b/zellij-utils/src/input/layout.rs
@@ -569,6 +569,13 @@ impl TiledPaneLayout {
// if max_panes is 1, it means there's only enough panes for this node,
// if max_panes is 0, this is probably the root layout being called with 0 max panes
if max_panes <= 1 {
+ while !self.children.is_empty() {
+ // this is a special case: we're truncating a pane that was previously a logical
+ // container but now should be an actual pane - so here we'd like to use its
+ // deepest "non-logical" child in order to get all its attributes (eg. borderless)
+ let first_child = self.children.remove(0);
+ drop(std::mem::replace(self, first_child));
+ }
self.children.clear();
} else if max_panes <= self.children.len() {
self.children.truncate(max_panes);