mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-04 02:39:20 +00:00
fix(repl):blocks input of characters than 1 byte
This commit is contained in:
parent
beed07ec35
commit
22ed2f65bb
1 changed files with 4 additions and 0 deletions
|
@ -142,6 +142,7 @@ impl StdinReader {
|
|||
this.trim_matches(|c: char| c.is_whitespace())
|
||||
.to_string()
|
||||
.replace(['\n', '\r'], "")
|
||||
.replace(|c: char| c.len_utf8() >= 2, "")
|
||||
};
|
||||
line.insert_str(position, &clipboard);
|
||||
position += clipboard.len();
|
||||
|
@ -226,6 +227,9 @@ impl StdinReader {
|
|||
break;
|
||||
}
|
||||
(KeyCode::Char(c), _) => {
|
||||
if c.len_utf8() >= 2{
|
||||
continue;
|
||||
}
|
||||
line.insert(position, c);
|
||||
position += 1;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue