vis

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

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

commit 4835649b460769c6158fcc3c968e9bd3e52d181e
parent 2f7ce389456ac86f72b1682785c31b0ae891f33b
Author: Marc André Tanner <mat@brain-dump.org>
Date:   Mon, 28 Mar 2016 22:29:51 +0200

sam: fix default regexp handling i.e. ':sam x'

Diffstat:
Msam.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sam.c b/sam.c @@ -407,7 +407,7 @@ static Command *command_parse(Vis *vis, const char **s, int level, enum SamError cmd->count = parse_number(s); if (cmddef->flags & CMD_REGEX) { - if (cmddef->flags & CMD_REGEX_DEFAULT && **s == ' ') { + if ((cmddef->flags & CMD_REGEX_DEFAULT) && (!**s || **s == ' ')) { skip_spaces(s); } else if (!(cmd->regex = parse_regex(vis, s))) { *err = SAM_ERR_REGEX;