Patch 8.2.2943

19 views
Skip to first unread message

Bram Moolenaar

unread,
Jun 5, 2021, 12:50:08 PM6/5/21
to vim...@googlegroups.com

Patch 8.2.2943
Problem: Vim9: check for argument count ignores default values.
Solution: Take default argument values into account.
Files: src/vim9execute.c


*** ../vim-8.2.2942/src/vim9execute.c 2021-06-05 18:15:06.614037266 +0200
--- src/vim9execute.c 2021-06-05 18:48:09.805886192 +0200
***************
*** 4234,4240 ****
semsg(_(e_nr_arguments_too_many), idx);
goto failed_early;
}
! else if (idx < 0)
{
if (idx == -1)
emsg(_(e_one_argument_too_few));
--- 4234,4241 ----
semsg(_(e_nr_arguments_too_many), idx);
goto failed_early;
}
! 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));
*** ../vim-8.2.2942/src/version.c 2021-06-05 18:15:06.614037266 +0200
--- src/version.c 2021-06-05 18:47:37.281956040 +0200
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 2943,
/**/

--
INSPECTOR END OF FILM: Move along. There's nothing to see! Keep moving!
[Suddenly he notices the cameras.]
INSPECTOR END OF FILM: (to Camera) All right, put that away sonny.
[He walks over to it and puts his hand over the lens.]
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages