summaryrefslogtreecommitdiff
path: root/src/search.c
diff options
context:
space:
mode:
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)