From 3cb675f804600c3215b97698d6c42b90e07b6c9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Tue, 15 Mar 2016 19:46:06 +0100 Subject: vis: do properly replay ": and "/ registers This makes @: (and @/) work. --- README.md | 3 ++- vis.c | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index dbdb42e..c0bc823 100644 --- a/README.md +++ b/README.md @@ -263,7 +263,8 @@ Operators can be forced to work line wise by specifying `V`. The general purpose registers `[a-z]` can be used to record macros. Use one of `[A-Z]` to append to an existing macro. `q` starts a recording, - `@` plays it back. `@@` refers to the least recently recorded macro. + `@` plays it back. `@@` refers to the least recently recorded macro. + `@:` repeats the last :-command. `@/` is equivalent to `n` in normal mode. ### Command line prompt diff --git a/vis.c b/vis.c index cfdc210..e815012 100644 --- a/vis.c +++ b/vis.c @@ -976,6 +976,13 @@ static void macro_replay(Vis *vis, const Macro *macro) { } bool vis_macro_replay(Vis *vis, enum VisRegister id) { + if (id == VIS_REG_SEARCH) + return vis_motion(vis, VIS_MOVE_SEARCH_NEXT); + if (id == VIS_REG_COMMAND) { + const char *cmd = register_get(vis, &vis->registers[id], NULL); + return vis_cmd(vis, cmd); + } + Macro *macro = macro_get(vis, id); if (!macro || macro == vis->recording) return false; -- cgit v1.2.3