mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:8.2.2430: :vimgrep expands wildcards twice (#13853)
Problem: :vimgrep expands wildcards twice.
Solution: Do not expand wildcards a second time.
f8c6a17180
This commit is contained in:
parent
55add1c1c8
commit
b2713f11b4
@ -1639,10 +1639,10 @@ int get_arglist_exp(char_u *str, int *fcountp, char_u ***fnamesp, bool wig)
|
||||
|
||||
if (wig) {
|
||||
i = expand_wildcards(ga.ga_len, (char_u **)ga.ga_data,
|
||||
fcountp, fnamesp, EW_FILE|EW_NOTFOUND);
|
||||
fcountp, fnamesp, EW_FILE|EW_NOTFOUND|EW_NOTWILD);
|
||||
} else {
|
||||
i = gen_expand_wildcards(ga.ga_len, (char_u **)ga.ga_data,
|
||||
fcountp, fnamesp, EW_FILE|EW_NOTFOUND);
|
||||
fcountp, fnamesp, EW_FILE|EW_NOTFOUND|EW_NOTWILD);
|
||||
}
|
||||
|
||||
ga_clear(&ga);
|
||||
|
@ -5264,7 +5264,7 @@ void ex_vimgrep(exarg_T *eap)
|
||||
qf_new_list(qi, title);
|
||||
}
|
||||
|
||||
// parse the list of arguments
|
||||
// Parse the list of arguments, wildcards have already been expanded.
|
||||
if (get_arglist_exp(p, &fcount, &fnames, true) == FAIL) {
|
||||
goto theend;
|
||||
}
|
||||
|
@ -2650,6 +2650,13 @@ func Test_vimgrep()
|
||||
call XvimgrepTests('l')
|
||||
endfunc
|
||||
|
||||
func Test_vimgrep_wildcards_expanded_once()
|
||||
new X[id-01] file.txt
|
||||
call setline(1, 'some text to search for')
|
||||
vimgrep text %
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
" Test for incsearch highlighting of the :vimgrep pattern
|
||||
" This test used to cause "E315: ml_get: invalid lnum" errors.
|
||||
func Test_vimgrep_incsearch()
|
||||
|
Loading…
Reference in New Issue
Block a user