editor: Fix singleton multibuffer titles not being replicated (#40896)

Release Notes:

- N/A *or* Added/Fixed/Improved ...
This commit is contained in:
Lukas Wirth
2025-10-22 14:59:30 +00:00
committed by GitHub
parent 69b2ee7bf0
commit d0398da099
2 changed files with 5 additions and 1 deletions
+1 -1
View File
@@ -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,
+4
View File
@@ -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();