vis
a vi-like editor based on Plan 9's structural regular expressions
git clone https://9o.is/git/vis.git
commit ef5a2f25d5061ce7909f582f116da14301be1436 parent 8a95fd4be70c08db662c4b22ecfde83601128292 Author: Marc André Tanner <mat@brain-dump.org> Date: Tue, 15 Mar 2016 19:46:06 +0100 vis: do properly replay ": and "/ registers This makes @: (and @/) work. Diffstat:
| M | README.md | | | 3 | ++- |
| M | vis.c | | | 7 | +++++++ |
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git 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 @@ -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;