summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Brabandt <cb@256bit.org>2021-12-01 10:54:24 +0000
committerBram Moolenaar <Bram@vim.org>2021-12-01 10:54:24 +0000
commit0b226f60be5c30c32fb01fc0b6dc11286e7e2313 (patch)
tree6274052c2c2956101bcb8203b50bad184fc7c289
parent05e59e3a9ffddbf93c7af02cd2ba1d0f822d4625 (diff)
patch 8.2.3713: MS-Windows: no error if vimgrep pattern is not matchingv8.2.3713
Problem: MS-Windows: No error message if vimgrep pattern is not matching. Solution: Give an error message. (Christian Brabandt, closes #9245, closes #8762)
-rw-r--r--src/quickfix.c5
-rw-r--r--src/testdir/test_quickfix.vim15
-rw-r--r--src/version.c2
3 files changed, 19 insertions, 3 deletions
diff --git a/src/quickfix.c b/src/quickfix.c
index 4405d4b64b..d7c0a88a62 100644
--- a/src/quickfix.c
+++ b/src/quickfix.c
@@ -6122,9 +6122,8 @@ vgr_process_args(
}
// Parse the list of arguments, wildcards have already been expanded.
- if (get_arglist_exp(p, &args->fcount, &args->fnames, TRUE) == FAIL)
- return FAIL;
- if (args->fcount == 0)
+ if ((get_arglist_exp(p, &args->fcount, &args->fnames, TRUE) == FAIL) ||
+ args->fcount == 0)
{
emsg(_(e_nomatch));
return FAIL;
diff --git a/src/testdir/test_quickfix.vim b/src/testdir/test_quickfix.vim
index 7bf453fa3b..24526bd77a 100644
--- a/src/testdir/test_quickfix.vim
+++ b/src/testdir/test_quickfix.vim
@@ -5621,4 +5621,19 @@ func Test_win_gettype()
lclose
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
diff --git a/src/version.c b/src/version.c
index d6f409ed5c..30be8aedf8 100644
--- a/src/version.c
+++ b/src/version.c
@@ -754,6 +754,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 3713,
+/**/
3712,
/**/
3711,