Mercurial > vim
diff src/evalfunc.c @ 15239:db5d2429bda3 v8.1.0629
patch 8.1.0629: "gn" selects the wrong text with a multi-line match
commit https://github.com/vim/vim/commit/5d24a2257e597fd752e33b2c1e9c19cf9114a517
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Dec 23 19:10:09 2018 +0100
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 https://github.com/vim/vim/issues/3695)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 23 Dec 2018 19:15:05 +0100 |
parents | dada0b389d4f |
children | 8d7a3fd70ff4 |
line wrap: on
line diff
--- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -10056,7 +10056,7 @@ search_cmn(typval_T *argvars, pos_T *mat } pos = save_cursor = curwin->w_cursor; - subpatnum = searchit(curwin, curbuf, &pos, dir, pat, 1L, + subpatnum = searchit(curwin, curbuf, &pos, NULL, dir, pat, 1L, options, RE_SEARCH, (linenr_T)lnum_stop, &tm, NULL); if (subpatnum != FAIL) { @@ -10414,7 +10414,7 @@ do_searchpair( pat = pat3; for (;;) { - n = searchit(curwin, curbuf, &pos, dir, pat, 1L, + n = searchit(curwin, curbuf, &pos, NULL, dir, pat, 1L, options, RE_SEARCH, lnum_stop, &tm, NULL); if (n == FAIL || (firstpos.lnum != 0 && EQUAL_POS(pos, firstpos))) /* didn't find it or found the first match again: FAIL */