vrepl: fix slow response for empty line input (after just pressing 'enter/return') (fix #23856) (#23858)

This commit is contained in:
kbkpbot 2025-03-05 06:01:36 +08:00 committed by GitHub
parent cec123a0df
commit 698018cd3f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -423,16 +423,13 @@ fn run_repl(workdir string, vrepl_prefix string) int {
}
oline := r.get_one_line(prompt) or { break }
line := oline.trim_space()
if line == '' && oline.ends_with('\n') {
if line == '' {
continue
}
if line.len <= -1 || line == 'exit' {
break
}
r.line = line
if r.line == '\n' {
continue
}
if r.line == 'clear' {
term.erase_clear()
continue