0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

patch 8.2.1101: no error when using wrong arguments for setqflist()

Problem:    No error when using wrong arguments for setqflist() or
            setloclist().
Solution:   Check for the error.
This commit is contained in:
Bram Moolenaar
2020-06-30 22:11:44 +02:00
parent 47e880d6c1
commit be7a50c22f
3 changed files with 13 additions and 0 deletions

View File

@@ -7400,6 +7400,14 @@ set_errorlist(
return OK;
}
// A dict argument cannot be specified with a non-empty list argument
if (list != NULL && list->lv_len != 0 && what != NULL)
{
semsg(_(e_invarg2),
_("cannot have both a list and a \"what\" argument"));
return FAIL;
}
incr_quickfix_busy();
if (what != NULL)

View File

@@ -2360,6 +2360,9 @@ func Xproperty_tests(cchar)
call assert_equal(['Colors'], newl2.context)
call assert_equal('Line10', newl2.items[0].text)
call g:Xsetlist([], 'f')
" Cannot specify both a non-empty list argument and a dict argument
call assert_fails("call g:Xsetlist([{}], ' ', {})", 'E475:')
endfunc
func Test_qf_property()

View File

@@ -754,6 +754,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1101,
/**/
1100,
/**/