vis
a vi-like editor based on Plan 9's structural regular expressions
git clone https://9o.is/git/vis.git
commit 84004298da631b42e8603d46f8a0561e09f63396 parent 7d132474e2261e84c2ae499bed8f692d0ccd659f Author: Marc André Tanner <mat@brain-dump.org> Date: Tue, 15 Sep 2015 09:13:27 +0200 vis: convert to/till movements to new input handling Diffstat:
| M | vis.c | | | 12 | +++++------- |
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/vis.c b/vis.c @@ -1064,16 +1064,14 @@ static const char *changecase(const char *keys, const Arg *arg) { } static const char *movement_key(const char *keys, const Arg *arg) { - const char *key = getkey(); - if (!key) { - action_reset(&vis->action); - return keys; - } - strncpy(vis->search_char, key, sizeof(vis->search_char)); + if (!keys[0]) + return NULL; + const char *next = utfnext(keys+1); + strncpy(vis->search_char, keys, next - keys); vis->last_totill = arg->i; vis->action.movement = &moves[arg->i]; action_do(&vis->action); - return keys; + return next; } static const char *movement(const char *keys, const Arg *arg) {