mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-12 05:15:00 +00: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
1 changed files with 1 additions and 5 deletions
|
@ -538,11 +538,7 @@ impl Item for Editor {
|
||||||
let description = path.to_string_lossy();
|
let description = path.to_string_lossy();
|
||||||
Some(
|
Some(
|
||||||
Label::new(
|
Label::new(
|
||||||
if description.len() > MAX_TAB_TITLE_LEN {
|
util::truncate_and_trailoff(&description, MAX_TAB_TITLE_LEN),
|
||||||
description[..MAX_TAB_TITLE_LEN].to_string() + "…"
|
|
||||||
} else {
|
|
||||||
description.into()
|
|
||||||
},
|
|
||||||
style.description.text.clone(),
|
style.description.text.clone(),
|
||||||
)
|
)
|
||||||
.contained()
|
.contained()
|
||||||
|
|
Loading…
Reference in a new issue