From e8d2f3612fd975fe7225a23e5a7fa5810a2576ee Mon Sep 17 00:00:00 2001 From: Gokul Soumya Date: Fri, 25 Jun 2021 09:32:57 +0530 Subject: [PATCH] Use unicode_width to correctly truncate picker chars --- helix-tui/src/buffer.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)