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 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'vis.c') 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); +} -- cgit v1.2.3