vis

a vi-like editor based on Plan 9's structural regular expressions

git clone https://9o.is/git/vis.git

commit c679dc728b5d8077d24b25b6f214df469fb24048
parent 1d6669a16afb6a0f949e11098ab59a393292a13e
Author: Marc André Tanner <mat@brain-dump.org>
Date:   Thu, 26 Jan 2017 15:10:32 +0100

vis: do not repeat insertion while showing prompt

Previously something like `5ifoo<Escape>:<Escape>` would insert
foo into the command prompt.

Diffstat:
Mvis-modes.c | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git 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;