vis

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

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

commit 69967823ca95908d0e7d443746b6354f5a121174
parent d6de19695de3dd27f4d329d83075f5df5a01adf6
Author: Marc André Tanner <mat@brain-dump.org>
Date:   Wed,  6 Apr 2016 22:03:18 +0200

vis: fix vi filter operators ! and =

Diffstat:
Mvis-modes.c | 3++-
Mvis.c | 6++----
2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/vis-modes.c b/vis-modes.c @@ -78,7 +78,8 @@ static void vis_mode_visual_line_enter(Vis *vis, Mode *old) { for (Cursor *c = view_cursors(vis->win->view); c; c = view_cursors_next(c)) view_cursors_selection_start(c); } - vis_motion(vis, VIS_MOVE_NOP); + if (!vis->action.op) + vis_motion(vis, VIS_MOVE_NOP); } static void vis_mode_visual_line_leave(Vis *vis, Mode *new) { diff --git a/vis.c b/vis.c @@ -584,12 +584,10 @@ void action_do(Vis *vis, Action *a) { } else if (a->op == &vis_operators[VIS_OP_REPLACE]) { vis_mode_switch(vis, VIS_MODE_REPLACE); } else if (a->op == &vis_operators[VIS_OP_FILTER]) { - if (a->arg.s) { - vis_mode_switch(vis, VIS_MODE_NORMAL); + if (a->arg.s) vis_cmd(vis, a->arg.s); - } else { + else vis_prompt_show(vis, ":|"); - } } else if (vis->mode == &vis_modes[VIS_MODE_OPERATOR_PENDING]) { mode_set(vis, vis->mode_prev); } else if (vis->mode->visual) {