aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2016-03-15 19:46:06 +0100
committerMarc André Tanner <mat@brain-dump.org>2016-03-15 20:05:12 +0100
commit3cb675f804600c3215b97698d6c42b90e07b6c9d (patch)
treebb8d389fff510902a4e0b8deadfe441043df6af3
parentb24f677d6ee23801e7377765aaed32327912d3e8 (diff)
downloadvis-3cb675f804600c3215b97698d6c42b90e07b6c9d.tar.gz
vis-3cb675f804600c3215b97698d6c42b90e07b6c9d.tar.xz
vis: do properly replay ": and "/ registers
This makes @: (and @/) work.
-rw-r--r--README.md3
-rw-r--r--vis.c7
2 files changed, 9 insertions, 1 deletions
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;