Sync OpenBSD patchset 354:

Support C-n/C-p with emacs keys in choice mode, also fix a comment.
This commit is contained in:
Tiago Cunha 2009-10-05 18:18:50 +00:00
parent a9a0cd8297
commit 19e502c64e

View File

@ -1,4 +1,4 @@
/* $Id: mode-key.c,v 1.28 2009-09-02 22:45:17 tcunha Exp $ */ /* $Id: mode-key.c,v 1.29 2009-10-05 18:18:50 tcunha Exp $ */
/* /*
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net> * Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
@ -191,7 +191,7 @@ struct mode_key_tree mode_key_tree_vi_copy;
/* emacs editing keys. */ /* emacs editing keys. */
const struct mode_key_entry mode_key_emacs_edit[] = { const struct mode_key_entry mode_key_emacs_edit[] = {
{ '\001' /* C-a */, 0, MODEKEYEDIT_STARTOFLINE }, { '\001' /* C-a */, 0, MODEKEYEDIT_STARTOFLINE },
{ '\002' /* C-p */, 0, MODEKEYEDIT_CURSORLEFT }, { '\002' /* C-b */, 0, MODEKEYEDIT_CURSORLEFT },
{ '\003' /* C-c */, 0, MODEKEYEDIT_CANCEL }, { '\003' /* C-c */, 0, MODEKEYEDIT_CANCEL },
{ '\004' /* C-d */, 0, MODEKEYEDIT_DELETE }, { '\004' /* C-d */, 0, MODEKEYEDIT_DELETE },
{ '\005' /* C-e */, 0, MODEKEYEDIT_ENDOFLINE }, { '\005' /* C-e */, 0, MODEKEYEDIT_ENDOFLINE },
@ -221,6 +221,8 @@ struct mode_key_tree mode_key_tree_emacs_edit;
/* emacs choice selection keys. */ /* emacs choice selection keys. */
const struct mode_key_entry mode_key_emacs_choice[] = { const struct mode_key_entry mode_key_emacs_choice[] = {
{ '\003' /* C-c */, 0, MODEKEYCHOICE_CANCEL }, { '\003' /* C-c */, 0, MODEKEYCHOICE_CANCEL },
{ '\016' /* C-n */, 0, MODEKEYCHOICE_DOWN },
{ '\020' /* C-p */, 0, MODEKEYCHOICE_UP },
{ '\033' /* Escape */, 0, MODEKEYCHOICE_CANCEL }, { '\033' /* Escape */, 0, MODEKEYCHOICE_CANCEL },
{ '\r', 0, MODEKEYCHOICE_CHOOSE }, { '\r', 0, MODEKEYCHOICE_CHOOSE },
{ 'q', 0, MODEKEYCHOICE_CANCEL }, { 'q', 0, MODEKEYCHOICE_CANCEL },