0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.2.2943: Vim9: check for argument count ignores default values

Problem:    Vim9: check for argument count ignores default values.
Solution:   Take default argument values into account.
This commit is contained in:
Bram Moolenaar
2021-06-05 18:49:38 +02:00
parent 8da6d6db34
commit c6d71532dd
2 changed files with 4 additions and 1 deletions

View File

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

View File

@@ -4234,7 +4234,8 @@ call_def_function(
semsg(_(e_nr_arguments_too_many), idx);
goto failed_early;
}
else if (idx < 0)
idx = argc - ufunc->uf_args.ga_len + ufunc->uf_def_args.ga_len;
if (idx < 0)
{
if (idx == -1)
emsg(_(e_one_argument_too_few));