vim-patch:9.0.1233: search() loops forever if "skip" is TRUE for all matches (#21956)

Problem:    search() loops forever if "skip" is TRUE for all matches.
Solution:   Keep the position of the first match.

3d79f0a430

Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
zeertzjq
2023-01-23 07:36:01 +08:00
committed by GitHub
parent 1b642648f6
commit 0f633ff494
2 changed files with 19 additions and 1 deletions

View File

@@ -6239,7 +6239,9 @@ static int search_cmn(typval_T *argvars, pos_T *match_pos, int *flagsp)
// didn't find it or no skip argument
break;
}
firstpos = pos;
if (firstpos.lnum == 0) {
firstpos = pos;
}
// If the skip expression matches, ignore this match.
{