From d0398da09955e2642eb3c6ec0d1eb7bb509f4355 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Wed, 22 Oct 2025 16:59:30 +0200 Subject: [PATCH] editor: Fix singleton multibuffer titles not being replicated (#40896) Release Notes: - N/A *or* Added/Fixed/Improved ... --- crates/editor/src/items.rs | 2 +- crates/multi_buffer/src/multi_buffer.rs | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/editor/src/items.rs b/crates/editor/src/items.rs index 6a5552f8c7a689e310c548e11c3a516fb9aedbe3..28a416925672a937a163e85fcaa59066529481b1 100644 --- a/crates/editor/src/items.rs +++ b/crates/editor/src/items.rs @@ -226,7 +226,7 @@ impl FollowableItem for Editor { Some(proto::view::Variant::Editor(proto::view::Editor { singleton: buffer.is_singleton(), - title: (!buffer.is_singleton()).then(|| buffer.title(cx).into()), + title: buffer.explicit_title().map(ToOwned::to_owned), excerpts, scroll_top_anchor: Some(serialize_anchor(&scroll_anchor.anchor, &snapshot)), scroll_x: scroll_anchor.offset.x, diff --git a/crates/multi_buffer/src/multi_buffer.rs b/crates/multi_buffer/src/multi_buffer.rs index e9e3b6f62c2bd5ec4a40ea8329aaf05110f91173..e6e2f7f1c68f976473b5e6ee8b60ca8652aa4b1d 100644 --- a/crates/multi_buffer/src/multi_buffer.rs +++ b/crates/multi_buffer/src/multi_buffer.rs @@ -2556,6 +2556,10 @@ impl MultiBuffer { self.buffers.values().for_each(|state| f(&state.buffer)) } + pub fn explicit_title(&self) -> Option<&str> { + self.title.as_deref() + } + pub fn title<'a>(&'a self, cx: &'a App) -> Cow<'a, str> { if let Some(title) = self.title.as_ref() { return title.into();