0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.2.2726: confusing error message with white space before comma

Problem:    Confusing error message with white space before comma in the
            arguments of a function declaration.
Solution:   Give a specific error message. (closes #2235)
This commit is contained in:
Bram Moolenaar
2021-04-06 19:01:03 +02:00
parent e8c4660a55
commit 86cdb8a4bd
3 changed files with 22 additions and 0 deletions

View File

@@ -307,6 +307,17 @@ get_function_args(
emsg(_("E989: Non-default argument follows default argument"));
goto err_ret;
}
if (VIM_ISWHITE(*p) && *skipwhite(p) == ',')
{
// Be tolerant when skipping
if (!skip)
{
semsg(_(e_no_white_space_allowed_before_str_str), ",", p);
goto err_ret;
}
p = skipwhite(p);
}
if (*p == ',')
{
++p;