diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2016-04-06 22:03:18 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2016-04-06 22:03:18 +0200 |
| commit | 02c6df7cd4bca89506cf1d0e4a08bd719e8f17d3 (patch) | |
| tree | 716ab80c80d6780eec3715fcfc2c62e0f0742154 | |
| parent | 66fd883b71cc592880f263f7aea67ce71f1bd186 (diff) | |
| download | vis-02c6df7cd4bca89506cf1d0e4a08bd719e8f17d3.tar.gz vis-02c6df7cd4bca89506cf1d0e4a08bd719e8f17d3.tar.xz | |
vis: fix vi filter operators ! and =
| -rw-r--r-- | vis-modes.c | 3 | ||||
| -rw-r--r-- | vis.c | 6 |
2 files changed, 4 insertions, 5 deletions
diff --git a/vis-modes.c b/vis-modes.c index 177b034..b44212f 100644 --- 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) { @@ -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) { |
