From b6600d07666ae38a090acdc604720d882612bab5 Mon Sep 17 00:00:00 2001 From: dinocosta Date: Tue, 26 Aug 2025 17:33:00 +0100 Subject: [PATCH] chore: use only filename in tab content Co-authored-by: Conrad Irwin --- crates/diagnostics/src/buffer_diagnostics.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/crates/diagnostics/src/buffer_diagnostics.rs b/crates/diagnostics/src/buffer_diagnostics.rs index 9cc3056085..4e71dc1796 100644 --- a/crates/diagnostics/src/buffer_diagnostics.rs +++ b/crates/diagnostics/src/buffer_diagnostics.rs @@ -781,14 +781,20 @@ impl Item for BufferDiagnosticsEditor { } // Builds the content to be displayed in the tab. - fn tab_content(&self, params: TabContentParams, _window: &Window, _app: &App) -> AnyElement { + fn tab_content(&self, params: TabContentParams, _window: &Window, _cx: &App) -> AnyElement { let error_count = self.summary.error_count; let warning_count = self.summary.warning_count; - let label = Label::new(self.project_path.path.to_sanitized_string()); + let label = Label::new( + self.project_path + .path + .file_name() + .map(|f| f.to_sanitized_string()) + .unwrap_or_else(|| self.project_path.path.to_sanitized_string()), + ); h_flex() .gap_1() - .child(label.color(params.text_color())) + .child(label) .when(error_count == 0 && warning_count == 0, |parent| { parent.child( h_flex()