diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2017-06-05 09:26:17 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2017-06-05 09:55:36 +0200 |
| commit | 081d99dda082a360dad367e8e2cc036a738edca5 (patch) | |
| tree | c74924c0e4d3f46503638e0c2b874d5773427406 /sam.c | |
| parent | 7aad8b11369ba01215690704c552046f4f70ad9a (diff) | |
| download | vis-081d99dda082a360dad367e8e2cc036a738edca5.tar.gz vis-081d99dda082a360dad367e8e2cc036a738edca5.tar.xz | |
sam: fix + address
Previoulsy + would not advance to the next line when the cursor was
on the first character of a line. This should fix the +- idiom, i.e.
:+-x/foo/c/bar/
performs a substitution on the current line.
Diffstat (limited to 'sam.c')
| -rw-r--r-- | sam.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -980,7 +980,7 @@ static Filerange address_line_evaluate(Address *addr, File *file, Filerange *ran size_t start = range->start, end = range->end, line; if (sign > 0) { char c; - if (end > 0 && text_byte_get(txt, end-1, &c) && c == '\n') + if (start < end && end > 0 && text_byte_get(txt, end-1, &c) && c == '\n') end--; line = text_lineno_by_pos(txt, end); line = text_pos_by_lineno(txt, line + offset); |
