diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2017-01-18 17:57:02 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2017-01-18 17:57:02 +0100 |
| commit | 1f44e63071206bf9933737374ab703cb4768b5e7 (patch) | |
| tree | b1425c53b521e6e735b61943c47f249ff17d55f1 /vis-modes.c | |
| parent | bc818d9222ab69a4bbb876d5843dcc4874accd48 (diff) | |
| download | vis-1f44e63071206bf9933737374ab703cb4768b5e7.tar.gz vis-1f44e63071206bf9933737374ab703cb4768b5e7.tar.xz | |
vis: fix count handling for append
Fix #371
Diffstat (limited to 'vis-modes.c')
| -rw-r--r-- | vis-modes.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/vis-modes.c b/vis-modes.c index 6f861d9..991b21b 100644 --- a/vis-modes.c +++ b/vis-modes.c @@ -142,9 +142,16 @@ static void vis_mode_normal_enter(Vis *vis, Mode *old) { if (vis->action_prev.op == &vis_operators[VIS_OP_MODESWITCH] && !vis->repeat_input) { vis->repeat_input = true; if (vis->action_prev.count > 1) { + /* temporarily disable motion, in something like `5atext` + * we should only move the cursor once then insert the text */ + const Movement *motion = vis->action_prev.movement; + if (motion) + vis->action_prev.movement = &vis_motions[VIS_MOVE_NOP]; + /* we already inserted the text once, so temporarily decrease count */ vis->action_prev.count--; vis_repeat(vis); vis->action_prev.count++; + vis->action_prev.movement = motion; } vis->repeat_input = false; } |
