To: vim_dev@googlegroups.com Subject: Patch 8.2.2943 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ 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 -- Bram@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 ///