Skip to content

Commit

Permalink
fix(ux): only damage the relevant swap layout layer when resizing pan…
Browse files Browse the repository at this point in the history
  • Loading branch information
imsnif authored and Tomcat-42 committed Nov 9, 2024
1 parent 246c9e6 commit 5e0e048
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions zellij-server/src/tab/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2312,19 +2312,20 @@ impl Tab {
}
pub fn resize(&mut self, client_id: ClientId, strategy: ResizeStrategy) -> Result<()> {
let err_context = || format!("unable to resize pane");
self.swap_layouts.set_is_floating_damaged();
self.swap_layouts.set_is_tiled_damaged();
if self.floating_panes.panes_are_visible() {
let successfully_resized = self
.floating_panes
.resize_active_pane(client_id, &mut self.os_api, &strategy)
.with_context(err_context)?;
if successfully_resized {
self.swap_layouts.set_is_floating_damaged();
self.set_force_render(); // we force render here to make sure the panes under the floating pane render and don't leave "garbage" in case of a decrease
}
} else {
match self.tiled_panes.resize_active_pane(client_id, &strategy) {
Ok(_) => {},
Ok(_) => {
self.swap_layouts.set_is_tiled_damaged();
},
Err(err) => match err.downcast_ref::<ZellijError>() {
Some(ZellijError::CantResizeFixedPanes { pane_ids }) => {
let mut pane_ids_to_error = vec![];
Expand Down

0 comments on commit 5e0e048

Please # to comment.