From 8d43ed05648ba21ef2ba2b423111696b0dc5a287 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Mon, 27 Jul 2009 12:11:12 +0000 Subject: Add a key to delete to end of line at the prompt (^K in emacs mode, C/D in vi). From Kalle Olavi Niemitalo. --- usr.bin/tmux/mode-key.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'usr.bin/tmux/mode-key.c') 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 @@ -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); -- cgit v1.2.3