mirror of
https://github.com/vim/vim.git
synced 2025-09-26 04:04:07 -04:00
patch 8.2.3713: MS-Windows: no error if vimgrep pattern is not matching
Problem: MS-Windows: No error message if vimgrep pattern is not matching. Solution: Give an error message. (Christian Brabandt, closes #9245, closes #8762)
This commit is contained in:
committed by
Bram Moolenaar
parent
05e59e3a9f
commit
0b226f60be
@@ -6122,9 +6122,8 @@ vgr_process_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;
|
||||||
|
@@ -5621,4 +5621,19 @@ 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
|
||||||
|
|
||||||
" vim: shiftwidth=2 sts=2 expandtab
|
" vim: shiftwidth=2 sts=2 expandtab
|
||||||
|
@@ -753,6 +753,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
3713,
|
||||||
/**/
|
/**/
|
||||||
3712,
|
3712,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user