vis

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

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

commit ecb6a61690ba58ef2ee5048e70fd9b311442855b
parent 63e71c2e79e2a1be8f586597f2b24a83b347eb9d
Author: Marc André Tanner <mat@brain-dump.org>
Date:   Sun, 15 Mar 2020 07:28:41 +0100

sam: fix X and Y commands which were interchanged

Fix #820

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

diff --git a/sam.c b/sam.c @@ -1558,8 +1558,8 @@ static bool cmd_files(Vis *vis, Win *win, Command *cmd, const char *argv[], Sele for (Win *win = vis->windows; win; win = win->next) { if (win->file->internal) continue; - bool match = !cmd->regex || (win->file->name && - text_regex_match(cmd->regex, win->file->name, 0)); + bool match = !cmd->regex || + (win->file->name && text_regex_match(cmd->regex, win->file->name, 0) == 0); if (match ^ (argv[0][0] == 'Y')) { Filerange def = text_range_new(0, 0); ret &= sam_execute(vis, win, cmd->cmd, NULL, &def);