From a675eb1667703f459db2a670407d5ca3e5799f76 Mon Sep 17 00:00:00 2001 From: Cole Miller Date: Mon, 1 Dec 2025 21:32:36 -0500 Subject: [PATCH] Fix regression in closing project diff (#43964) Follow-up to #43586--when the diff is not split, just render the primary editor. Otherwise the child `Pane` intercepts `CloseActiveItem`. (This is still a bug for the actual split diff, but just fixing the user-visible regression for now.) Release Notes: - N/A --- crates/editor/src/split.rs | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/crates/editor/src/split.rs b/crates/editor/src/split.rs index ff821de287ecf61a651393f437a13334ddf1f85e..8a413a376f2296acdacddc97707a6112e8cd5185 100644 --- a/crates/editor/src/split.rs +++ b/crates/editor/src/split.rs @@ -243,20 +243,25 @@ impl Render for SplittableEditor { window: &mut ui::Window, cx: &mut ui::Context, ) -> impl ui::IntoElement { - let Some(active) = self.panes.panes().into_iter().next() else { - return div().into_any_element(); + let inner = if self.secondary.is_none() { + self.primary_editor.clone().into_any_element() + } else if let Some(active) = self.panes.panes().into_iter().next() { + self.panes + .render( + None, + &ActivePaneDecorator::new(active, &self.workspace), + window, + cx, + ) + .into_any_element() + } else { + div().into_any_element() }; div() .id("splittable-editor") .on_action(cx.listener(Self::split)) .on_action(cx.listener(Self::unsplit)) .size_full() - .child(self.panes.render( - None, - &ActivePaneDecorator::new(active, &self.workspace), - window, - cx, - )) - .into_any_element() + .child(inner) } }