vim-patch:8.2.2295: incsearch does not detect empty pattern properly

Problem:    Incsearch does not detect empty pattern properly.
Solution:   Return magic state when skipping over a pattern. (Christian
            Brabandt, closes vim/vim#7612, closes vim/vim#6420)

d93a7fc1a9
This commit is contained in:
zeertzjq
2022-12-04 09:09:00 +08:00
parent a91ba088ab
commit 46e4be0fd0
11 changed files with 140 additions and 45 deletions

View File

@@ -1089,7 +1089,7 @@ int do_search(oparg_T *oap, int dirc, int search_delim, char *pat, long count, i
// Find end of regular expression.
// If there is a matching '/' or '?', toss it.
ps = (char_u *)strcopy;
p = skip_regexp_ex(pat, search_delim, magic_isset(), &strcopy, NULL);
p = skip_regexp_ex(pat, search_delim, magic_isset(), &strcopy, NULL, NULL);
if (strcopy != (char *)ps) {
// made a copy of "pat" to change "\?" to "?"
searchcmdlen += (int)(strlen(pat) - strlen(strcopy));