fix(readline): dont do anything if length of input rune slice is 0

this fixes an issue when readline splits multiline input.
sometimes, the multiple lines just end up being "stray?"
inputs of enter plus a newline. this can happen if a user attempts
to prefire the enter key while a command is running, for example
pull/215/merge
TorchedSammy 2022-12-10 17:27:42 -04:00
parent f7e725b5b9
commit 8d40179a73
Signed by: sammyette
GPG Key ID: 904FC49417B44DCD
1 changed files with 4 additions and 0 deletions

View File

@ -546,6 +546,10 @@ func (rl *Instance) Readline() (string, error) {
// entry readline is currently configured for and then update the line entries
// accordingly.
func (rl *Instance) editorInput(r []rune) {
if len(r) == 0 {
return
}
switch rl.modeViMode {
case VimKeys:
rl.vi(r[0])