2
2
mirror of https://github.com/Hilbis/Hilbish synced 2025-03-30 10:13:23 +00:00

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

This commit is contained in:
TorchedSammy 2022-04-12 21:02:01 -04:00
parent f002eca258
commit 1715a1f626
Signed by: sammyette
GPG Key ID: 904FC49417B44DCD

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: