Allow selection in vi mode.

This commit is contained in:
Nicholas Marriott 2009-02-21 17:46:13 +00:00
parent 78f420e7a9
commit afd67ce89f
3 changed files with 7 additions and 5 deletions

View File

@ -1,4 +1,4 @@
/* $Id: mode-key.c,v 1.9 2009-02-13 21:39:45 nicm Exp $ */ /* $Id: mode-key.c,v 1.10 2009-02-21 17:46:13 nicm Exp $ */
/* /*
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net> * Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
@ -94,7 +94,7 @@ mode_key_lookup_vi(struct mode_key_data *mdata, int key)
} }
break; break;
case '\r': case '\r':
if (mdata->flags & MODEKEY_CANEDIT) if (mdata->flags & (MODEKEY_CANEDIT|MODEKEY_CHOOSEMODE))
return (MODEKEYCMD_CHOOSE); return (MODEKEYCMD_CHOOSE);
return (MODEKEYCMD_COPYSELECTION); return (MODEKEYCMD_COPYSELECTION);
case '0': case '0':

3
tmux.h
View File

@ -1,4 +1,4 @@
/* $Id: tmux.h,v 1.273 2009-02-13 21:39:45 nicm Exp $ */ /* $Id: tmux.h,v 1.274 2009-02-21 17:46:13 nicm Exp $ */
/* /*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -428,6 +428,7 @@ struct mode_key_data {
int flags; int flags;
#define MODEKEY_EDITMODE 0x1 #define MODEKEY_EDITMODE 0x1
#define MODEKEY_CANEDIT 0x2 #define MODEKEY_CANEDIT 0x2
#define MODEKEY_CHOOSEMODE 0x4
}; };
#define MODEKEY_EMACS 0 #define MODEKEY_EMACS 0

View File

@ -1,4 +1,4 @@
/* $Id: window-choose.c,v 1.11 2009-02-13 21:39:45 nicm Exp $ */ /* $Id: window-choose.c,v 1.12 2009-02-21 17:46:13 nicm Exp $ */
/* /*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net> * Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@ -119,7 +119,8 @@ window_choose_init(struct window_pane *wp)
s->mode |= MODE_MOUSE; s->mode |= MODE_MOUSE;
mode_key_init(&data->mdata, mode_key_init(&data->mdata,
options_get_number(&wp->window->options, "mode-keys"), 0); options_get_number(&wp->window->options, "mode-keys"),
MODEKEY_CHOOSEMODE);
return (s); return (s);
} }