feat: add ctrl delete to forward delete word (closes #124)

ctrl-delete
TorchedSammy 2022-04-12 20:05:17 -04:00
parent f002eca258
commit ab4fa85c26
Signed by: sammyette
GPG Key ID: 904FC49417B44DCD
2 changed files with 13 additions and 0 deletions

View File

@ -49,6 +49,7 @@ var (
seqEndSc = string([]byte{27, 91, 52, 126}) seqEndSc = string([]byte{27, 91, 52, 126})
seqDelete = string([]byte{27, 91, 51, 126}) seqDelete = string([]byte{27, 91, 51, 126})
seqDelete2 = string([]byte{27, 91, 80}) seqDelete2 = string([]byte{27, 91, 80})
seqCtrlDelete = string([]byte{27, 91, 51, 59, 53, 126})
seqShiftTab = string([]byte{27, 91, 90}) seqShiftTab = string([]byte{27, 91, 90})
seqAltQuote = string([]byte{27, 34}) // Added for showing registers ^[" seqAltQuote = string([]byte{27, 34}) // Added for showing registers ^["
seqAltR = string([]byte{27, 114}) // Used for alternative history seqAltR = string([]byte{27, 114}) // Used for alternative history

View File

@ -777,6 +777,18 @@ func (rl *Instance) escapeSeq(r []rune) {
rl.viDeleteByAdjust(rl.viJumpB(tokeniseLine)) rl.viDeleteByAdjust(rl.viJumpB(tokeniseLine))
rl.updateHelpers() rl.updateHelpers()
case seqCtrlDelete:
if rl.modeTabCompletion {
rl.resetVirtualComp(false)
}
// This is only available in Insert mode
if rl.modeViMode != VimInsert {
return
}
rl.saveToRegister(rl.viJumpW(tokeniseLine))
rl.viDeleteByAdjust(rl.viJumpW(tokeniseLine))
rl.updateHelpers()
default: default:
if rl.modeTabFind { if rl.modeTabFind {
return return