diff options
| author | Aram Drevekenin <aram@poor.dev> | 2025-02-21 12:16:39 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-21 12:16:39 +0100 |
| commit | 2c8ef3b5b8e25d66d9e875b26a367d73a77bce7b (patch) | |
| tree | d6f1a7f198e43430db78633f3bb97bd09f756a5b | |
| parent | docs(changelog): chrono upgrade (diff) | |
| download | sl0ppij-2c8ef3b5b8e25d66d9e875b26a367d73a77bce7b.tar.gz sl0ppij-2c8ef3b5b8e25d66d9e875b26a367d73a77bce7b.tar.xz sl0ppij-2c8ef3b5b8e25d66d9e875b26a367d73a77bce7b.zip | |
fix(tiled-panes): recover from full stack (#4011)
| -rw-r--r-- | zellij-server/src/panes/tiled_panes/mod.rs | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/zellij-server/src/panes/tiled_panes/mod.rs b/zellij-server/src/panes/tiled_panes/mod.rs index 80913058..40048cfd 100644 --- a/zellij-server/src/panes/tiled_panes/mod.rs +++ b/zellij-server/src/panes/tiled_panes/mod.rs @@ -229,7 +229,7 @@ impl TiledPanes { fn add_pane( &mut self, pane_id: PaneId, - mut pane: Box<dyn Pane>, + pane: Box<dyn Pane>, should_relayout: bool, client_id: Option<ClientId>, ) { @@ -245,6 +245,14 @@ impl TiledPanes { return; } } + self.add_pane_without_stacked_resize(pane_id, pane, should_relayout) + } + fn add_pane_without_stacked_resize( + &mut self, + pane_id: PaneId, + mut pane: Box<dyn Pane>, + should_relayout: bool, + ) { let cursor_height_width_ratio = self.cursor_height_width_ratio(); let mut pane_grid = TiledPaneGrid::new( &mut self.panes, @@ -252,8 +260,6 @@ impl TiledPanes { *self.display_area.borrow(), *self.viewport.borrow(), ); - // TODO: make sure this is really the same as the pre-stacked-resizes function... and - // behaves the same and all let pane_id_and_split_direction = pane_grid.find_room_for_new_pane(cursor_height_width_ratio); match pane_id_and_split_direction { @@ -317,8 +323,8 @@ impl TiledPanes { self.set_force_render(); // TODO: why do we need this? return; }, - Err(e) => { - log::error!("Failed to add pane to stack: {:?}", e); + Err(_e) => { + return self.add_pane_without_stacked_resize(pane_id, pane, should_relayout); }, } } |
