[dev] [vis][PATCH v2] Make the '.' Filerange work on one line

From: Silvan Jegen <s.jegen_AT_gmail.com>
Date: Fri, 15 May 2015 10:16:49 +0200

---
The first version broke some functionality. This one doesn't by doing
some more ugly checking.
We also make sure that we include the newline by using text_line_next
instead of text_line_finish.
 vis.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/vis.c b/vis.c
index 051f256..a714bf0 100644
--- a/vis.c
+++ b/vis.c
_AT_@ -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 orig = **cmd;
 	switch (**cmd) {
 	case '%':
 		r.start = 0;
_AT_@ -1714,8 +1715,11 @@ static Filerange parse_range(char **cmd) {
 		break;
 	default:
 		r.start = parse_pos(cmd);
-		if (**cmd != ',')
+		if (orig != ',') {
+			if (orig == '.')
+				r.end = text_line_next(txt, r.start);
 			return r;
+		}
 		(*cmd)++;
 		r.end = parse_pos(cmd);
 		break;
-- 
2.4.0
Received on Fri May 15 2015 - 10:16:49 CEST

This archive was generated by hypermail 2.3.0 : Fri May 15 2015 - 10:24:07 CEST