vim-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 vim/vim#3695)
5d24a2257e
This commit is contained in:
erw7
2019-05-27 19:05:11 +09:00
parent 16b1e8f9c0
commit 485972dd64
7 changed files with 71 additions and 64 deletions

View File

@@ -3750,12 +3750,12 @@ static linenr_T get_address(exarg_T *eap,
// Start the search just like for the above do_search().
pos.col = (*cmd != '?') ? MAXCOL : 0;
pos.coladd = 0;
if (searchit(curwin, curbuf, &pos,
if (searchit(curwin, curbuf, &pos, NULL,
*cmd == '?' ? BACKWARD : FORWARD,
(char_u *)"", 1L, SEARCH_MSG,
i, (linenr_T)0, NULL, NULL) != FAIL)
i, (linenr_T)0, NULL, NULL) != FAIL) {
lnum = pos.lnum;
else {
} else {
cmd = NULL;
goto error;
}