From 9091346d44f5b1e6f61249feede28846d22351f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Tue, 23 Aug 2016 16:38:43 +0200 Subject: vis: improve dot (repeat) command implmentation Do not override implicit operator macro in command mode. Fix #334 --- vis.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'vis.c') diff --git a/vis.c b/vis.c index f6b28f1..ed14875 100644 --- a/vis.c +++ b/vis.c @@ -544,16 +544,17 @@ static void window_jumplist_invalidate(Win *win) { ringbuf_invalidate(win->jumplist); } -void action_do(Vis *vis, Action *a) { +void vis_do(Vis *vis) { Win *win = vis->win; Text *txt = win->file->text; View *view = win->view; + Action *a = &vis->action; if (a->op == &vis_operators[VIS_OP_FILTER] && !vis->mode->visual) vis_mode_switch(vis, VIS_MODE_VISUAL_LINE); int count = MAX(a->count, 1); - bool repeatable = a->op && !vis->macro_operator; + bool repeatable = a->op && !vis->macro_operator && !vis->win->parent; bool multiple_cursors = view_cursors_multiple(view); bool linewise = !(a->type & CHARWISE) && ( a->type & LINEWISE || (a->movement && a->movement->type & LINEWISE) || @@ -1113,7 +1114,8 @@ void vis_repeat(Vis *vis) { /* for some operators count should be applied only to the macro not the motion */ if (vis->action_prev.op == &vis_operators[VIS_OP_INSERT] || vis->action_prev.op == &vis_operators[VIS_OP_REPLACE]) vis->action_prev.count = 1; - action_do(vis, &vis->action_prev); + vis->action = vis->action_prev; + vis_do(vis); vis->action_prev.count = count; if (macro) { Mode *mode = vis->mode; -- cgit v1.2.3