Fully remove panes and update internal data structures

This commit is contained in:
Mikayla Maki 2023-05-08 17:09:29 -07:00
parent 8fd0c9fb0e
commit 9b2d3fcd48
No known key found for this signature in database

View File

@ -147,7 +147,14 @@ impl SerializedPaneGroup {
} else {
let pane = pane.upgrade(cx)?;
workspace
.update(cx, |workspace, cx| workspace.remove_pane(pane, cx))
.update(cx, |workspace, cx| {
workspace.panes.retain(|p| p != &pane);
cx.focus(workspace.panes.last().unwrap());
if workspace.last_active_center_pane == Some(pane.downgrade()) {
workspace.last_active_center_pane = None;
}
cx.notify();
})
.log_err()?;
None
}