vis

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

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

commit 9c26b91465e452ed05605341eb37baa0d0ce66fc
parent a8e8c3eb95deaeac267079b830067c129fe3f263
Author: Marc André Tanner <mat@brain-dump.org>
Date:   Sat, 25 Oct 2014 15:43:43 +0200

Set correct default range for commands

Diffstat:
Mvis.c | 9++++++---
1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/vis.c b/vis.c @@ -1521,9 +1521,12 @@ static bool exec_cmdline_command(char *cmdline) { char *cmdstart = cmdline; Filerange range = parse_range(&cmdstart); - if (cmdstart != cmdline && !text_range_valid(&range)) { - editor_info_show(vis, "Invalid range\n"); - return false; + if (!text_range_valid(&range)) { + if (cmdstart != cmdline) { + editor_info_show(vis, "Invalid range\n"); + return false; + } + range = (Filerange){ .start = 0, .end = text_size(vis->win->text) }; } char *cmdend = strchr(cmdstart, ' '); /* regex should only apply to command name */