vis
a vi-like editor based on Plan 9's structural regular expressions
git clone https://9o.is/git/vis.git
commit 6be9b4e36f13307ea97ede284f6216defd552c05 parent aeafc8bf2f40b5a3458b1cc3d5bc7eadbd626da2 Author: Marc André Tanner <mat@brain-dump.org> Date: Thu, 14 May 2015 19:38:52 +0200 In command mode make the '.' range specifier match the current line Diffstat:
| M | vis.c | | | 6 | +++++- |
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/vis.c b/vis.c @@ -1701,6 +1701,7 @@ static Filerange parse_range(char **cmd) { Text *txt = vis->win->file->text; Filerange r = text_range_empty(); Mark *marks = vis->win->file->marks; + char start = **cmd; switch (**cmd) { case '%': r.start = 0; @@ -1714,8 +1715,11 @@ static Filerange parse_range(char **cmd) { break; default: r.start = parse_pos(cmd); - if (**cmd != ',') + if (**cmd != ',') { + if (start == '.') + r.end = text_line_next(txt, r.start); return r; + } (*cmd)++; r.end = parse_pos(cmd); break;