mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:8.2.3713: MS-Windows: no error if vimgrep pattern is not matching (#20947)
Problem: MS-Windows: No error message if vimgrep pattern is not matching.
Solution: Give an error message. (Christian Brabandt, closes vim/vim#9245,
closes vim/vim#8762)
0b226f60be
Co-authored-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
parent
19729e2136
commit
d5dd7573f3
@ -5325,10 +5325,8 @@ static int vgr_process_args(exarg_T *eap, vgr_args_T *args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Parse the list of arguments, wildcards have already been expanded.
|
// Parse the list of arguments, wildcards have already been expanded.
|
||||||
if (get_arglist_exp(p, &args->fcount, &args->fnames, true) == FAIL) {
|
if (get_arglist_exp(p, &args->fcount, &args->fnames, true) == FAIL
|
||||||
return FAIL;
|
|| args->fcount == 0) {
|
||||||
}
|
|
||||||
if (args->fcount == 0) {
|
|
||||||
emsg(_(e_nomatch));
|
emsg(_(e_nomatch));
|
||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
|
@ -5801,6 +5801,21 @@ func Test_win_gettype()
|
|||||||
lclose
|
lclose
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
fun Test_vimgrep_nomatch()
|
||||||
|
call XexprTests('c')
|
||||||
|
call g:Xsetlist([{'lnum':10,'text':'Line1'}])
|
||||||
|
copen
|
||||||
|
if has("win32")
|
||||||
|
call assert_fails('vimgrep foo *.zzz', 'E479:')
|
||||||
|
let expected = [{'lnum': 10, 'bufnr': 0, 'end_lnum': 0, 'pattern': '', 'valid': 0, 'vcol': 0, 'nr': 0, 'module': '', 'type': '', 'end_col': 0, 'col': 0, 'text': 'Line1'}]
|
||||||
|
else
|
||||||
|
call assert_fails('vimgrep foo *.zzz', 'E480:')
|
||||||
|
let expected = []
|
||||||
|
endif
|
||||||
|
call assert_equal(expected, getqflist())
|
||||||
|
cclose
|
||||||
|
endfunc
|
||||||
|
|
||||||
" Test for opening the quickfix window in two tab pages and then closing one
|
" Test for opening the quickfix window in two tab pages and then closing one
|
||||||
" of the quickfix windows. This should not make the quickfix buffer unlisted.
|
" of the quickfix windows. This should not make the quickfix buffer unlisted.
|
||||||
" (github issue #9300).
|
" (github issue #9300).
|
||||||
|
Loading…
Reference in New Issue
Block a user