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(