aboutsummaryrefslogtreecommitdiff
path: root/sam.c
diff options
context:
space:
mode:
Diffstat (limited to 'sam.c')
-rw-r--r--sam.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sam.c b/sam.c
index 490d253..8e7b51f 100644
--- a/sam.c
+++ b/sam.c
@@ -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;