ui/embed: don't increase cursor with multibyte chars

When waiting for a multibyte unicode codepoint to fill up, don't
increase cursor at all.
jmap
Manos Pitsidianakis 2019-11-16 20:00:42 +02:00
parent 04e1137b36
commit e1dec05881
Signed by: Manos Pitsidianakis
GPG Key ID: 73627C2F690DF710
1 changed files with 3 additions and 0 deletions

View File

@ -256,12 +256,15 @@ impl EmbedGrid {
match codepoints {
CodepointBuf::None if c & 0b1110_0000 == 0b1100_0000 => {
*codepoints = CodepointBuf::TwoCodepoints(vec![c]);
return;
}
CodepointBuf::None if c & 0b1111_0000 == 0b1110_0000 => {
*codepoints = CodepointBuf::ThreeCodepoints(vec![c]);
return;
}
CodepointBuf::None if c & 0b1111_1000 == 0b1111_0000 => {
*codepoints = CodepointBuf::FourCodepoints(vec![c]);
return;
}
CodepointBuf::TwoCodepoints(buf) => {
grid[cursor_val!()].set_ch(