mirror of
https://github.com/vlang/v.git
synced 2025-09-11 08:25:42 -04:00
vrepl: fix slow response for empty line input (after just pressing 'enter/return') (fix #23856) (#23858)
This commit is contained in:
parent
cec123a0df
commit
698018cd3f
@ -423,16 +423,13 @@ fn run_repl(workdir string, vrepl_prefix string) int {
|
|||||||
}
|
}
|
||||||
oline := r.get_one_line(prompt) or { break }
|
oline := r.get_one_line(prompt) or { break }
|
||||||
line := oline.trim_space()
|
line := oline.trim_space()
|
||||||
if line == '' && oline.ends_with('\n') {
|
if line == '' {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if line.len <= -1 || line == 'exit' {
|
if line.len <= -1 || line == 'exit' {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
r.line = line
|
r.line = line
|
||||||
if r.line == '\n' {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
if r.line == 'clear' {
|
if r.line == 'clear' {
|
||||||
term.erase_clear()
|
term.erase_clear()
|
||||||
continue
|
continue
|
||||||
|
Loading…
x
Reference in New Issue
Block a user