summaryrefslogtreecommitdiff
path: root/src/search.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-11-25 21:13:47 +0000
committerBram Moolenaar <Bram@vim.org>2022-11-25 21:13:47 +0000
commitc96311b5be307f5a1d1b20a0ec930d63964e7335 (patch)
treef65fa05bc13a76539535f0db94e9723c51303d9a /src/search.c
parentef2c325f5e3c437b722bb96bf369ba2a5c541163 (diff)
downloadvim-git-c96311b5be307f5a1d1b20a0ec930d63964e7335.tar.gz
patch 9.0.0950: the pattern "\_s\zs" matches at EOLv9.0.0950
Problem: The pattern "\_s\zs" matches at EOL. Solution: Make the pattern "\_s\zs" match at the start of the next line. (closes #11617)
Diffstat (limited to 'src/search.c')
-rw-r--r--src/search.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/search.c b/src/search.c
index 8045bd735..a4ec4448a 100644
--- a/src/search.c
+++ b/src/search.c
@@ -793,6 +793,8 @@ searchit(
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 @@ searchit(
}
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)