Fix panel not resizing after external file deletion (#26378)

Previously, when a file was deleted externally and the warning prompt
was dismissed with "Close", the panel remained but was empty, leaving an
unused split space.

This happened because pane.remove_item(...) was being called with
close_pane_if_empty set to false, preventing the panel from being
removed even when it had no remaining items.

This fix changes the third boolean parameter to true, ensuring that the
panel is removed if it becomes empty, allowing the layout to properly
resize.

Closes #23904

Release Notes:

- N/A
This commit is contained in:
Cristiano Pantea 2025-03-11 22:52:55 +00:00 committed by GitHub
parent 09a4cfd307
commit a364a13458
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1878,7 +1878,7 @@ impl Pane {
}
Ok(1) => {
pane.update_in(cx, |pane, window, cx| {
pane.remove_item(item.item_id(), false, false, window, cx)
pane.remove_item(item.item_id(), false, true, window, cx)
})?;
}
_ => return Ok(false),