Support delete to end of line and delete line.

This commit is contained in:
2025-11-29 21:40:07 -08:00
parent b41946c470
commit 40d33e1847
6 changed files with 139 additions and 62 deletions

View File

@@ -9,6 +9,9 @@ KLookupKCommand(const int ascii_key, const bool ctrl, CommandId &out) -> bool
if (ctrl) {
switch (k) {
case 'd':
out = CommandId::KillLine;
return true; // C-k C-d
case 'x':
out = CommandId::SaveAndQuit;
return true; // C-k C-x
@@ -20,6 +23,9 @@ KLookupKCommand(const int ascii_key, const bool ctrl, CommandId &out) -> bool
}
} else {
switch (k) {
case 'd':
out = CommandId::KillToEOL;
return true; // C-k d
case 's':
out = CommandId::Save;
return true; // C-k s
@@ -45,6 +51,9 @@ KLookupCtrlCommand(const int ascii_key, CommandId &out) -> bool
{
const int k = KLowerAscii(ascii_key);
switch (k) {
case 'd':
out = CommandId::DeleteChar; // C-d
return true;
case 'n':
out = CommandId::MoveDown;
return true;