fix unicode character width

This commit is contained in:
Ian Henry 2021-04-04 21:42:25 -07:00
parent 106c6712be
commit 8f031c5fcc

View File

@ -112,8 +112,7 @@ impl<'a> View<'a> {
// Find long utf sequences and extract it from mat.x
let line = &self.state.lines[mat.y as usize];
let prefix = &line[0..mat.x as usize];
let extra = prefix.width_cjk() - prefix.chars().count();
let offset = (mat.x as u16) - (extra as u16);
let offset = prefix.width() as u16;
let text = self.make_hint_text(mat.text);
print!(