From fbb9265b95ab46824b7bc01621a01eb6a2362000 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Sun, 25 Oct 2015 14:50:24 +0100 Subject: vis: introduce vis_repeat API --- vis.c | 14 +++++++++----- vis.h | 2 ++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/vis.c b/vis.c index 4323b4f..e61dd5b 100644 --- a/vis.c +++ b/vis.c @@ -727,11 +727,7 @@ static const char *suspend(Vis *vis, const char *keys, const Arg *arg) { } static const char *repeat(Vis *vis, const char *keys, const Arg *arg) { - int count = vis->action.count; - vis->action = vis->action_prev; - if (count) - vis->action.count = count; - action_do(vis, &vis->action); + vis_repeat(vis); return keys; } @@ -2835,3 +2831,11 @@ bool vis_macro_replay(Vis *vis, enum VisMacro id) { buffer_release(&buf); return true; } + +void vis_repeat(Vis *vis) { + int count = vis->action.count; + vis->action = vis->action_prev; + if (count) + vis->action.count = count; + action_do(vis, &vis->action); +} diff --git a/vis.h b/vis.h index 9de6df4..9cd8b70 100644 --- a/vis.h +++ b/vis.h @@ -147,6 +147,8 @@ bool vis_macro_record(Vis*, enum VisMacro); bool vis_macro_record_stop(Vis*); bool vis_macro_replay(Vis*, enum VisMacro); +void vis_repeat(Vis*); + bool vis_cmd(Vis*, const char *cmdline); const char *vis_keys(Vis*, const char *input); -- cgit v1.2.3