Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Add manual removal code to remove_panes

Mikayla Maki49335d017a76
diff --git a/crates/workspace/src/workspace.rs b/crates/workspace/src/workspace.rs
index d69484caa77..4a6ae57f078 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();
+ },
}
}