diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2016-08-23 16:38:43 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2016-08-24 11:10:00 +0200 |
| commit | 9091346d44f5b1e6f61249feede28846d22351f0 (patch) | |
| tree | d61d9b774a805d1a651482f47a16d8d5d1d9940b /vis.c | |
| parent | e2d51321f7284d11d9344e22117db31372fbe7a0 (diff) | |
| download | vis-9091346d44f5b1e6f61249feede28846d22351f0.tar.gz vis-9091346d44f5b1e6f61249feede28846d22351f0.tar.xz | |
vis: improve dot (repeat) command implmentation
Do not override implicit operator macro in command mode.
Fix #334
Diffstat (limited to 'vis.c')
| -rw-r--r-- | vis.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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; |
