vis
a vi-like editor based on Plan 9's structural regular expressions
git clone https://9o.is/git/vis.git
commit 5110f4e238b67b24cdf16686a9f35c908f3c9191 parent 9e64d80863e31e3b52c20b83a07c877e12ece301 Author: Marc André Tanner <mat@brain-dump.org> Date: Tue, 19 Jan 2016 20:47:54 +0100 vis: switch to normal mode if a :-command was successful in visual mode Diffstat:
| M | vis-prompt.c | | | 10 | ++++++++-- |
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/vis-prompt.c b/vis-prompt.c @@ -13,9 +13,15 @@ bool vis_prompt_cmd(Vis *vis, const char *cmd) { return vis_motion(vis, VIS_MOVE_SEARCH_BACKWARD, cmd+1); case '+': case ':': - return vis_cmd(vis, cmd+1); + { + bool ret = vis_cmd(vis, cmd+1); + if (ret && vis->mode->visual) + vis_mode_switch(vis, VIS_MODE_NORMAL); + return ret; + } + default: + return false; } - return false; } static void prompt_hide(Win *win) {