diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2015-09-14 21:52:10 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2015-10-05 15:57:13 +0200 |
| commit | 3b2ae3d2641c7f1755d6d7a7f740c8b15c8c883b (patch) | |
| tree | 86877462dfeaca0747092dc33a81385a42ea61aa | |
| parent | b763f2f26d756b14e54d30cd32743eb0ea269dc7 (diff) | |
| download | vis-3b2ae3d2641c7f1755d6d7a7f740c8b15c8c883b.tar.gz vis-3b2ae3d2641c7f1755d6d7a7f740c8b15c8c883b.tar.xz | |
vis: adapt r (replace) to new input handling
| -rw-r--r-- | vis.c | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -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) { |
