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)
diff --git a/src/userfunc.c b/src/userfunc.c
index 1139573..af107b0 100644
--- a/src/userfunc.c
+++ b/src/userfunc.c
@@ -307,6 +307,17 @@
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;