diff options
author | Gokul Soumya | 2021-06-25 04:02:57 +0000 |
---|---|---|
committer | Nathan Vegdahl | 2021-06-25 23:09:05 +0000 |
commit | e8d2f3612fd975fe7225a23e5a7fa5810a2576ee (patch) | |
tree | f6ef78ed4053c86ba78663cea0369f570a1167c9 /helix-tui | |
parent | c688288881bbabe0ea98fbae4866054224b8f877 (diff) |
Use unicode_width to correctly truncate picker chars
Diffstat (limited to 'helix-tui')
-rw-r--r-- | helix-tui/src/buffer.rs | 2 |
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) |