2
2
mirror of https://github.com/Hilbis/Hilbish synced 2025-04-01 11:13:24 +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() rl.clearHelpers()
return "", CtrlC return "", CtrlC
case charEOF: case charEOF: // ctrl d
rl.clearHelpers() if len(rl.line) == 0 {
return "", EOF rl.clearHelpers()
return "", EOF
}
if rl.modeTabFind {
rl.backspaceTabFind()
} else {
if (rl.pos < len(rl.line)) {
rl.deleteBackspace(true)
}
}
// Clear screen // Clear screen
case charCtrlL: case charCtrlL: