diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2009-07-27 12:11:12 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2009-07-27 12:11:12 +0000 |
commit | 8d43ed05648ba21ef2ba2b423111696b0dc5a287 (patch) | |
tree | add88ed7e7d7add3c36eb434b0a512186d9f0b58 /usr.bin/tmux/mode-key.c | |
parent | 248e7c96313a12990bebc14ef4e1ae12a2cd46ec (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 'usr.bin/tmux/mode-key.c')
-rw-r--r-- | usr.bin/tmux/mode-key.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/usr.bin/tmux/mode-key.c b/usr.bin/tmux/mode-key.c index 850a1b69955..6329393edae 100644 --- a/usr.bin/tmux/mode-key.c +++ b/usr.bin/tmux/mode-key.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mode-key.c,v 1.5 2009/07/26 21:42:08 nicm Exp $ */ +/* $OpenBSD: mode-key.c,v 1.6 2009/07/27 12:11:11 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net> @@ -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); |