vis

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

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

commit 753eda252cdf13a6269894cf80e8fe8d35439d8c
parent 8833510ac5b89b10ce6af9d49430a416eff96c66
Author: Marc André Tanner <mat@brain-dump.org>
Date:   Tue,  5 Apr 2016 10:29:39 +0200

sam: stop executing once a command fails

Diffstat:
Msam.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sam.c b/sam.c @@ -725,7 +725,7 @@ static bool sam_execute(Vis *vis, Win *win, Command *cmd, Cursor *cur, Filerange Mark start, end; Filerange group = *range; - for (Command *c = cmd->cmd; c; c = c->next) { + for (Command *c = cmd->cmd; c && ret; c = c->next) { if (!text_range_valid(&group)) return false; @@ -912,7 +912,7 @@ static bool cmd_select(Vis *vis, Win *win, Command *cmd, const char *argv[], Cur bool multiple_cursors = view_cursors_multiple(view); Cursor *primary = view_cursors_primary_get(view); - for (Cursor *c = view_cursors(view), *next; c; c = next) { + for (Cursor *c = view_cursors(view), *next; c && ret; c = next) { next = view_cursors_next(c); Filerange sel; size_t pos = view_cursors_pos(c);