From 053803099b5680089333af05c8be5841dad65deb Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Thu, 16 Apr 2026 15:46:33 +0300 Subject: [PATCH] Show better tab tooltip for multi buffers (#54060) Before, no tooltip was shown at all, now we show the full, not trimmed text: image Release Notes: - Show better tab tooltip for multi buffers --- crates/editor/src/items.rs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/crates/editor/src/items.rs b/crates/editor/src/items.rs index 87f97ad8e4e60ecd42708d7cb11e8cb647508f82..5ad584f1a4233a92ed1f04cde4db57bb9dc470f9 100644 --- a/crates/editor/src/items.rs +++ b/crates/editor/src/items.rs @@ -645,20 +645,25 @@ impl Item for Editor { } fn tab_tooltip_text(&self, cx: &App) -> Option { - self.buffer() - .read(cx) + let multi_buffer = self.buffer().read(cx); + if let Some(file) = multi_buffer .as_singleton() .and_then(|buffer| buffer.read(cx).file()) .and_then(|file| File::from_dyn(Some(file))) - .map(|file| { + { + Some( file.worktree .read(cx) .absolutize(&file.path) .compact() .to_string_lossy() .into_owned() - .into() - }) + .into(), + ) + } else { + let title = multi_buffer.title(cx); + (!title.is_empty()).then(|| title.to_string().into()) + } } fn telemetry_event_text(&self) -> Option<&'static str> {