aboutsummaryrefslogtreecommitdiff
path: root/vis.c
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2015-05-14 19:38:52 +0200
committerMarc André Tanner <mat@brain-dump.org>2015-05-14 19:38:52 +0200
commit1e3165ef5e684c648a323bf082e1892462b354de (patch)
treec1ef0c083fe26d254c9de847843d524d4ec121e5 /vis.c
parent55b1175aa7ee4c3f790c23dcca279dc5ed209725 (diff)
downloadvis-1e3165ef5e684c648a323bf082e1892462b354de.tar.gz
vis-1e3165ef5e684c648a323bf082e1892462b354de.tar.xz
In command mode make the '.' range specifier match the current line
Diffstat (limited to 'vis.c')
-rw-r--r--vis.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/vis.c b/vis.c
index 42b224e..7a090ae 100644
--- 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;