diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-11-25 21:13:47 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-11-25 21:13:47 +0000 |
commit | c96311b5be307f5a1d1b20a0ec930d63964e7335 (patch) | |
tree | f65fa05bc13a76539535f0db94e9723c51303d9a /src/search.c | |
parent | ef2c325f5e3c437b722bb96bf369ba2a5c541163 (diff) | |
download | vim-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.c | 6 |
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) |