aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2017-01-26 15:10:32 +0100
committerMarc André Tanner <mat@brain-dump.org>2017-01-26 21:48:52 +0100
commitb58b76bca867ee2a845c695faa3f1a5853cffc60 (patch)
treeb8ea10c79b009467220c01f7ad5b0a0ea068d3bd
parent01f014645b52b3fec69f684fd8fb8216d8e4d676 (diff)
downloadvis-b58b76bca867ee2a845c695faa3f1a5853cffc60.tar.gz
vis-b58b76bca867ee2a845c695faa3f1a5853cffc60.tar.xz
vis: do not repeat insertion while showing prompt
Previously something like `5ifoo<Escape>:<Escape>` would insert foo into the command prompt.
-rw-r--r--vis-modes.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/vis-modes.c b/vis-modes.c
index 4b5fb3c..4739c34 100644
--- a/vis-modes.c
+++ b/vis-modes.c
@@ -139,7 +139,8 @@ static void vis_mode_normal_enter(Vis *vis, Mode *old) {
if (old != mode_get(vis, VIS_MODE_INSERT) && old != mode_get(vis, VIS_MODE_REPLACE))
return;
macro_operator_stop(vis);
- if (vis->action_prev.op == &vis_operators[VIS_OP_MODESWITCH] && vis->action_prev.count > 1) {
+ if (!vis->win->parent && vis->action_prev.op == &vis_operators[VIS_OP_MODESWITCH] &&
+ 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;