fix(readline): only call raw input callback if not nil

lua-history^2
TorchedSammy 2022-07-13 15:35:33 -04:00
parent 9902560061
commit dd9bdca5e0
Signed by: sammyette
GPG Key ID: 904FC49417B44DCD
1 changed files with 3 additions and 1 deletions

View File

@ -94,7 +94,9 @@ func (rl *Instance) Readline() (string, error) {
rl.skipStdinRead = false
r := []rune(string(b))
rl.RawInputCallback(r[:i])
if rl.RawInputCallback != nil {
rl.RawInputCallback(r[:i])
}
if isMultiline(r[:i]) || len(rl.multiline) > 0 {
rl.multiline = append(rl.multiline, b[:i]...)