From 9fd9b1810c445e31d4599eb72e2fce3e67aa9c4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Sun, 15 Mar 2020 07:28:41 +0100 Subject: sam: fix X and Y commands which were interchanged Fix #820 --- sam.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sam.c') diff --git a/sam.c b/sam.c index d0c6557..5b4b636 100644 --- 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); -- cgit v1.2.3