diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-04-06 19:01:03 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-04-06 19:01:03 +0200 |
commit | 86cdb8a4bd1abff40b5f80c3c4149b33cbaab990 (patch) | |
tree | a4043b082ff789af6fa8b79c5be70aca287a89f7 /src/userfunc.c | |
parent | e8c4660a55364a5d3e395652d1202b8702666823 (diff) |
patch 8.2.2726: confusing error message with white space before commav8.2.2726
Problem: Confusing error message with white space before comma in the
arguments of a function declaration.
Solution: Give a specific error message. (closes #2235)
Diffstat (limited to 'src/userfunc.c')
-rw-r--r-- | src/userfunc.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/userfunc.c b/src/userfunc.c index 1139573c63..af107b0db6 100644 --- a/src/userfunc.c +++ b/src/userfunc.c @@ -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; |