diff --git a/src/consts.rs b/src/consts.rs index 5c24442..efdc28f 100644 --- a/src/consts.rs +++ b/src/consts.rs @@ -9,7 +9,7 @@ pub const COLOR: [&dyn termion::color::Color; 6] = [ ]; // Maximum length of labels. -pub const LABEL_SIZE_LIMIT: usize = 42; +pub const LABEL_SIZE_LIMIT: usize = 32; pub mod ui { pub const NAME: &str = env!("CARGO_PKG_NAME"); diff --git a/src/utils.rs b/src/utils.rs index 5972a74..0637108 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -8,7 +8,10 @@ pub fn unicode_length(input: &str) -> u16 { pub fn unicode_truncate(input: &mut String, limit: usize) { match UnicodeSegmentation::grapheme_indices(input.as_str(), true).nth(limit) { - Some((i, _)) => input.truncate(i), + Some((i, _)) => { + input.truncate(i); + input.push('…'); + }, None => (), } }