Browse Source

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.
tags/pre-alpha-0.4.0
Manos Pitsidianakis 1 year ago
parent
commit
e1dec05881
Signed by: epilys GPG Key ID: 73627C2F690DF710
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      ui/src/terminal/embed/grid.rs

+ 3
- 0
ui/src/terminal/embed/grid.rs 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(

Loading…
Cancel
Save