Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Truncate tabs in filenames (#50550)

Conrad Irwin3f6a6cfabf9f
diff --git a/crates/editor/src/items.rs b/crates/editor/src/items.rs
index 685387342ca..1a79414ddc3 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(