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-modes.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-modes.c')
| -rw-r--r-- | vis-modes.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/vis-modes.c b/vis-modes.c index eb4bfb0..fa69d24 100644 --- a/vis-modes.c +++ b/vis-modes.c @@ -114,11 +114,15 @@ static void vis_mode_visual_leave(Vis *vis, Mode *new) { } static void vis_mode_insert_enter(Vis *vis, Mode *old) { + if (vis->win->parent) + return; + if (!vis->action.op) { + action_reset(&vis->action_prev); + vis->action_prev.op = &vis_operators[VIS_OP_INSERT]; + } if (!vis->macro_operator) { macro_operator_record(vis); - action_reset(&vis->action_prev); vis->action_prev.macro = vis->macro_operator; - vis->action_prev.op = &vis_operators[VIS_OP_INSERT]; } } @@ -138,11 +142,15 @@ static void vis_mode_insert_input(Vis *vis, const char *str, size_t len) { } static void vis_mode_replace_enter(Vis *vis, Mode *old) { + if (vis->win->parent) + return; + if (!vis->action.op) { + action_reset(&vis->action_prev); + vis->action_prev.op = &vis_operators[VIS_OP_REPLACE]; + } if (!vis->macro_operator) { macro_operator_record(vis); - action_reset(&vis->action_prev); vis->action_prev.macro = vis->macro_operator; - vis->action_prev.op = &vis_operators[VIS_OP_REPLACE]; } } |
