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:
@@ -750,6 +750,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
2943,
|
||||
/**/
|
||||
2942,
|
||||
/**/
|
||||
|
@@ -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));
|
||||
|
Reference in New Issue
Block a user