From 3f6a6cfabf9f4a58a235e102c04040e6b736d113 Mon Sep 17 00:00:00 2001 From: Conrad Irwin Date: Mon, 2 Mar 2026 19:50:52 -0700 Subject: [PATCH] Truncate tabs in filenames (#50550) Closes #19208 Authored-By: @ngauder Release Notes: - Editor: truncate long file names in tab titles --------- Co-authored-by: Nikolas Gauder Co-authored-by: Zed Zippy <234243425+zed-zippy[bot]@users.noreply.github.com> --- crates/editor/src/items.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/crates/editor/src/items.rs b/crates/editor/src/items.rs index 685387342caf8e705a3648cb07acaa1867db55d8..1a79414ddc3aa57397d964d4e0af0d87bedc9c3b 100644 --- a/crates/editor/src/items.rs +++ b/crates/editor/src/items.rs @@ -735,10 +735,13 @@ impl Item for Editor { h_flex() .gap_2() .child( - Label::new(self.title(cx).to_string()) - .color(label_color) - .when(params.preview, |this| this.italic()) - .when(was_deleted, |this| this.strikethrough()), + Label::new(util::truncate_and_trailoff( + &self.title(cx), + MAX_TAB_TITLE_LEN, + )) + .color(label_color) + .when(params.preview, |this| this.italic()) + .when(was_deleted, |this| this.strikethrough()), ) .when_some(description, |this, description| { this.child(