mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
readline: remove new line \n character from readline output, now just Enter produces '' (#18934)
This commit is contained in:
parent
a3449098a9
commit
bf00ac656f
@ -133,6 +133,10 @@ pub fn (mut r Readline) read_line_utf8(prompt string) ![]rune {
|
||||
r.disable_raw_mode()
|
||||
if r.current.len == 0 {
|
||||
return error('empty line')
|
||||
} else {
|
||||
if r.current.last() == `\n` {
|
||||
r.current.pop()
|
||||
}
|
||||
}
|
||||
return r.current
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user