on master help sign in
Use unicode_width to correctly truncate picker chars
commite8d2f3612fd975fe7225a23e5a7fa5810a2576ee authorGokul Soumya <gokulps15@gmail.com> dateFri 25 Jun 2021, 09:32 (5 years ago) parentc688288
1 file changed+1−1
helix-tui/src/buffer.rs+1−1
helix-tui/src/buffer.rs+1−1
@@ -309,7 +309,7 @@ impl Buffer {
309309 index += width;
310310 x_offset += width;
311311 }
312− if ellipsis && x_offset - (x as usize) < string.as_ref().chars().count() {
312+ if ellipsis && x_offset - (x as usize) < UnicodeWidthStr::width(string.as_ref()) {
313313 self.content[index].set_symbol("…");
314314 }
315315 (x_offset as u16, y)