diff --git a/crates/workspace/src/workspace.rs b/crates/workspace/src/workspace.rs index d69484caa7..4a6ae57f07 100644 --- a/crates/workspace/src/workspace.rs +++ b/crates/workspace/src/workspace.rs @@ -2459,7 +2459,14 @@ impl Workspace { self.remove_panes(child.clone(), cx) } } - Member::Pane(pane) => self.remove_pane(pane.clone(), cx), + Member::Pane(pane) => { + self.panes.retain(|p| p != &pane); + cx.focus(self.panes.last().unwrap()); + if self.last_active_center_pane == Some(pane.downgrade()) { + self.last_active_center_pane = None; + } + cx.notify(); + }, } }