patch 9.0.0950: the pattern "\_s\zs" matches at EOL
Problem: The pattern "\_s\zs" matches at EOL.
Solution: Make the pattern "\_s\zs" match at the start of the next line.
(closes #11617)
diff --git a/src/search.c b/src/search.c
index 8045bd7..a4ec444 100644
--- a/src/search.c
+++ b/src/search.c
@@ -793,6 +793,8 @@
if (dir == FORWARD && at_first_line)
{
match_ok = TRUE;
+ matchcol = col;
+
/*
* When the match starts in a next line it's certainly
* past the start position.
@@ -837,7 +839,9 @@
}
else
{
- matchcol = matchpos.col;
+ // Advance "matchcol" to the next character.
+ // This does not use matchpos.col, because
+ // "\zs" may have have set it.
if (ptr[matchcol] != NUL)
{
if (has_mbyte)