From afd67ce89f91bd460b51c16108c92e3375d90402 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Sat, 21 Feb 2009 17:46:13 +0000 Subject: [PATCH] Allow selection in vi mode. --- mode-key.c | 4 ++-- tmux.h | 3 ++- window-choose.c | 5 +++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/mode-key.c b/mode-key.c index f1c54ec5..34c88e9b 100644 --- a/mode-key.c +++ b/mode-key.c @@ -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 @@ -94,7 +94,7 @@ mode_key_lookup_vi(struct mode_key_data *mdata, int key) } break; case '\r': - if (mdata->flags & MODEKEY_CANEDIT) + if (mdata->flags & (MODEKEY_CANEDIT|MODEKEY_CHOOSEMODE)) return (MODEKEYCMD_CHOOSE); return (MODEKEYCMD_COPYSELECTION); case '0': diff --git a/tmux.h b/tmux.h index 785a7031..2f0a434e 100644 --- a/tmux.h +++ b/tmux.h @@ -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 @@ -428,6 +428,7 @@ struct mode_key_data { int flags; #define MODEKEY_EDITMODE 0x1 #define MODEKEY_CANEDIT 0x2 +#define MODEKEY_CHOOSEMODE 0x4 }; #define MODEKEY_EMACS 0 diff --git a/window-choose.c b/window-choose.c index 13d1429b..44cec858 100644 --- a/window-choose.c +++ b/window-choose.c @@ -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 @@ -119,7 +119,8 @@ window_choose_init(struct window_pane *wp) s->mode |= MODE_MOUSE; 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); }