patch 8.1.0629: "gn" selects the wrong text with a multi-line match
Problem: "gn" selects the wrong text with a multi-line match.
Solution: Get the end position from searchit() directly. (closes #3695)
diff --git a/src/ex_getln.c b/src/ex_getln.c
index 4ea8bfa..4ad080a 100644
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -675,7 +675,7 @@
++emsg_off;
save = pat[patlen];
pat[patlen] = NUL;
- i = searchit(curwin, curbuf, &t,
+ i = searchit(curwin, curbuf, &t, NULL,
c == Ctrl_G ? FORWARD : BACKWARD,
pat, count, search_flags,
RE_SEARCH, 0, NULL, NULL);