From 3b2ae3d2641c7f1755d6d7a7f740c8b15c8c883b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Mon, 14 Sep 2015 21:52:10 +0200 Subject: vis: adapt r (replace) to new input handling --- vis.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'vis.c') diff --git a/vis.c b/vis.c index 300d500..108cba3 100644 --- a/vis.c +++ b/vis.c @@ -997,15 +997,16 @@ static const char *cursors_remove(const char *keys, const Arg *arg) { } static const char *replace(const char *keys, const Arg *arg) { - const char *key = getkey(); - if (!key) - return keys; + if (!keys[0]) + return NULL; + const char *next = utfnext(keys+1); + size_t len = next - keys; action_reset(&vis->action_prev); vis->action_prev.op = &ops[OP_REPEAT_REPLACE]; - buffer_put(&vis->buffer_repeat, key, strlen(key)); - editor_replace_key(vis, key, strlen(key)); + buffer_put(&vis->buffer_repeat, keys, len); + editor_replace_key(vis, keys, len); text_snapshot(vis->win->file->text); - return keys; + return next; } static const char *count(const char *keys, const Arg *arg) { -- cgit v1.2.3