feat: make ctrl d delete char below cursor if line isnt empty

pull/139/head
TorchedSammy 2022-04-12 21:02:01 -04:00
parent f002eca258
commit 1715a1f626
Signed by: sammyette
GPG Key ID: 904FC49417B44DCD
1 changed files with 12 additions and 3 deletions

View File

@ -170,9 +170,18 @@ func (rl *Instance) Readline() (string, error) {
rl.clearHelpers()
return "", CtrlC
case charEOF:
rl.clearHelpers()
return "", EOF
case charEOF: // ctrl d
if len(rl.line) == 0 {
rl.clearHelpers()
return "", EOF
}
if rl.modeTabFind {
rl.backspaceTabFind()
} else {
if (rl.pos < len(rl.line)) {
rl.deleteBackspace(true)
}
}
// Clear screen
case charCtrlL: