readline: fix bug that full-width spaces are treated as eof (#12763)
parent
7379488cee
commit
85f3372a32
|
@ -200,6 +200,9 @@ pub fn read_line(prompt string) ?string {
|
||||||
|
|
||||||
// analyse returns an `Action` based on the type of input byte given in `c`.
|
// analyse returns an `Action` based on the type of input byte given in `c`.
|
||||||
fn (r Readline) analyse(c int) Action {
|
fn (r Readline) analyse(c int) Action {
|
||||||
|
if c > 255 {
|
||||||
|
return Action.insert_character
|
||||||
|
}
|
||||||
match byte(c) {
|
match byte(c) {
|
||||||
`\0`, 0x3, 0x4, 255 {
|
`\0`, 0x3, 0x4, 255 {
|
||||||
return .eof
|
return .eof
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
println('Hello, world! | Привет, мир! | 你好世界')
|
println('Hello, world! | Привет, мир! | 你好世界 | こんにちは、世界。')
|
||||||
===output===
|
===output===
|
||||||
Hello, world! | Привет, мир! | 你好世界
|
Hello, world! | Привет, мир! | 你好世界 | こんにちは、世界。
|
||||||
|
|
Loading…
Reference in New Issue