aboutsummaryrefslogtreecommitdiff
path: root/helix-tui
diff options
context:
space:
mode:
authorGokul Soumya2021-06-25 04:02:57 +0000
committerNathan Vegdahl2021-06-25 23:09:05 +0000
commite8d2f3612fd975fe7225a23e5a7fa5810a2576ee (patch)
treef6ef78ed4053c86ba78663cea0369f570a1167c9 /helix-tui
parentc688288881bbabe0ea98fbae4866054224b8f877 (diff)
Use unicode_width to correctly truncate picker chars
Diffstat (limited to 'helix-tui')
-rw-r--r--helix-tui/src/buffer.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/helix-tui/src/buffer.rs b/helix-tui/src/buffer.rs
index 806a178b..2d93005b 100644
--- a/helix-tui/src/buffer.rs
+++ b/helix-tui/src/buffer.rs
@@ -309,7 +309,7 @@ impl Buffer {
index += width;
x_offset += width;
}
- if ellipsis && x_offset - (x as usize) < string.as_ref().chars().count() {
+ if ellipsis && x_offset - (x as usize) < UnicodeWidthStr::width(string.as_ref()) {
self.content[index].set_symbol("…");
}
(x_offset as u16, y)