diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2021-01-25 13:38:37 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2021-01-25 14:02:31 +0100 |
| commit | 80d0291b2ee9e7aae6683c973c263efbc02259c4 (patch) | |
| tree | 1ce66f891e7ea9ee1d21b4287564de55466d4edd /sam.c | |
| parent | 7b6c70ec6ea064aabd8e99b2d0d8ba285903bd0d (diff) | |
| download | vis-80d0291b2ee9e7aae6683c973c263efbc02259c4.tar.gz vis-80d0291b2ee9e7aae6683c973c263efbc02259c4.tar.xz | |
sam: only skip the last empty match if it follows a newline
This further tweaks the hack introduced to ignore the last match of ^
at the end of the file, see 1a158268c7693b00bf43c7e81034816d8d00358c.
Diffstat (limited to 'sam.c')
| -rw-r--r-- | sam.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -1424,7 +1424,8 @@ static int extract(Vis *vis, Win *win, Command *cmd, const char *argv[], Selecti * matches the zero-length string immediately after a * newline. Try filtering out the last such match at EOF. */ - if (end == match[0].start && start > range->start) + if (end == match[0].start && start > range->start && + text_byte_get(txt, end-1, &c) && c == '\n') break; } start = match[0].end; |
