Skip to content

Commit 2c1b643

Browse files
committed
fix alignment of UTF-8 characters
1 parent 9c79c7f commit 2c1b643

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ pub fn print_with_duration(line: &str, output: Option<&str>, duration: Duration)
3636
print!(" - {} {}", line, duration.dimmed());
3737

3838
if let Some(output) = output {
39-
let width = " - ".len() + line.len() + 1 + duration.len();
39+
let width = " - ".len() + line.chars().count() + 1 + duration.chars().count();
4040
let dots = DISPLAY_WIDTH - min(DISPLAY_WIDTH - 5, width) - 2;
4141
let dots: String = iter::repeat('.').take(dots).collect();
4242
println!(" {} {}", dots.dimmed(), output.bold());

0 commit comments

Comments
 (0)