mirror of
https://github.com/zed-industries/zed.git
synced 2024-11-10 05:37:29 +03:00
Merge pull request #2307 from zed-industries/fix-panic-in-editor-tab-content
Do UTF8-aware truncation on long item names in editor item
This commit is contained in:
commit
2a024a255f
@ -538,11 +538,7 @@ impl Item for Editor {
|
||||
let description = path.to_string_lossy();
|
||||
Some(
|
||||
Label::new(
|
||||
if description.len() > MAX_TAB_TITLE_LEN {
|
||||
description[..MAX_TAB_TITLE_LEN].to_string() + "…"
|
||||
} else {
|
||||
description.into()
|
||||
},
|
||||
util::truncate_and_trailoff(&description, MAX_TAB_TITLE_LEN),
|
||||
style.description.text.clone(),
|
||||
)
|
||||
.contained()
|
||||
|
Loading…
Reference in New Issue
Block a user