summaryrefslogtreecommitdiffstats
path: root/mode-key.c
diff options
context:
space:
mode:
authorTiago Cunha <tcunha@gmx.com>2009-08-16 19:29:24 +0000
committerTiago Cunha <tcunha@gmx.com>2009-08-16 19:29:24 +0000
commit646d6a929c81adbb978f88e14ff9b27dee0463d0 (patch)
treef95f2413f150f1746fc095e2356f1f1651fb79b2 /mode-key.c
parent6f9a2ee50a1100575eda807fae2689e42a531473 (diff)
Sync OpenBSD patchset 261:
Switch the prompt code to return an empty string when the user enters no response and reserve NULL for an explicit cancel. Change all callbacks to treat them the same so no functional change. Also add cancel key bindings to emacs mode which were missing.
Diffstat (limited to 'mode-key.c')
-rw-r--r--mode-key.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/mode-key.c b/mode-key.c
index f4a93cad..05804de2 100644
--- a/mode-key.c
+++ b/mode-key.c
@@ -1,4 +1,4 @@
-/* $Id: mode-key.c,v 1.24 2009-08-16 19:26:49 tcunha Exp $ */
+/* $Id: mode-key.c,v 1.25 2009-08-16 19:29:24 tcunha Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -181,6 +181,7 @@ struct mode_key_tree mode_key_tree_vi_copy;
const struct mode_key_entry mode_key_emacs_edit[] = {
{ '\001' /* C-a */, 0, MODEKEYEDIT_STARTOFLINE },
{ '\002' /* C-p */, 0, MODEKEYEDIT_CURSORLEFT },
+ { '\003' /* C-c */, 0, MODEKEYEDIT_CANCEL },
{ '\004' /* C-d */, 0, MODEKEYEDIT_DELETE },
{ '\005' /* C-e */, 0, MODEKEYEDIT_ENDOFLINE },
{ '\006' /* C-f */, 0, MODEKEYEDIT_CURSORRIGHT },
@@ -190,6 +191,7 @@ const struct mode_key_entry mode_key_emacs_edit[] = {
{ '\016' /* C-n */, 0, MODEKEYEDIT_HISTORYDOWN },
{ '\020' /* C-p */, 0, MODEKEYEDIT_HISTORYUP },
{ '\031' /* C-y */, 0, MODEKEYEDIT_PASTE },
+ { '\033' /* Escape */, 0, MODEKEYEDIT_CANCEL },
{ '\r', 0, MODEKEYEDIT_ENTER },
{ 'm' | KEYC_ESCAPE, 0, MODEKEYEDIT_STARTOFLINE },
{ KEYC_BSPACE, 0, MODEKEYEDIT_BACKSPACE },