summaryrefslogtreecommitdiffstats
path: root/src/ansi/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/ansi/mod.rs')
-rw-r--r--src/ansi/mod.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ansi/mod.rs b/src/ansi/mod.rs
index ae202d31..2b7b2f60 100644
--- a/src/ansi/mod.rs
+++ b/src/ansi/mod.rs
@@ -54,6 +54,10 @@ pub fn truncate_str<'a, 'b>(s: &'a str, display_width: usize, tail: &'b str) ->
for g in t.graphemes(true) {
let w = g.width();
if used + w > display_width {
+ // use space to fill the gap left by truncate. Need another
+ // option to custom this or just use `WrapOption.wrap_right_prefix_symbol`
+ // in the future.
+ result.push_str(&" ".repeat(display_width.saturating_sub(used)));
break;
}
result.push_str(g);