summaryrefslogtreecommitdiffstats
path: root/mode-key.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2009-07-27 12:11:11 +0000
committerNicholas Marriott <nicm@openbsd.org>2009-07-27 12:11:11 +0000
commitad0aad21d5dcc7d8c09a6c76e85ae1e46cf6b0da (patch)
treeeb08eb0c59cd214850b2da7eb36c8b5b3aa639e8 /mode-key.c
parentfc65da1eed07708030c0ae491cb8f4a6614de390 (diff)
Add a key to delete to end of line at the prompt (^K in emacs mode, C/D in vi).
From Kalle Olavi Niemitalo.
Diffstat (limited to 'mode-key.c')
-rw-r--r--mode-key.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/mode-key.c b/mode-key.c
index 9e5720eb..b037f281 100644
--- a/mode-key.c
+++ b/mode-key.c
@@ -110,6 +110,12 @@ mode_key_lookup_vi(struct mode_key_data *mdata, int key)
return (MODEKEYCMD_BACKTOINDENTATION);
case '\033':
return (MODEKEYCMD_CLEARSELECTION);
+ case 'C':
+ if (mdata->flags & MODEKEY_CANEDIT)
+ mdata->flags |= MODEKEY_EDITMODE;
+ return (MODEKEYCMD_DELETETOENDOFLINE);
+ case 'D':
+ return (MODEKEYCMD_DELETETOENDOFLINE);
case 'j':
case KEYC_DOWN:
return (MODEKEYCMD_DOWN);
@@ -169,6 +175,8 @@ mode_key_lookup_emacs(struct mode_key_data *mdata, int key)
case '\027':
case 'w' | KEYC_ESCAPE:
return (MODEKEYCMD_COPYSELECTION);
+ case '\013':
+ return (MODEKEYCMD_DELETETOENDOFLINE);
case '\016':
case KEYC_DOWN:
return (MODEKEYCMD_DOWN);