diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-04-10 17:18:09 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-04-10 17:18:09 +0200 |
commit | 962c43bf0d6a33b905f2acd920d3701476ebb5c9 (patch) | |
tree | bf4fba7f906f8b0c82ae605baefc0557f664bd71 /src/evalvars.c | |
parent | 599410cb3cb19946cd6df22441da5de003e114bb (diff) |
patch 8.2.2744: Vim9: no way to explicitly ignore an argumentv8.2.2744
Problem: Vim9: no way to explicitly ignore an argument.
Solution: Use the underscore as the name for an ignored argument.
Diffstat (limited to 'src/evalvars.c')
-rw-r--r-- | src/evalvars.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/evalvars.c b/src/evalvars.c index 67abdcb1d5..5869a82a61 100644 --- a/src/evalvars.c +++ b/src/evalvars.c @@ -3188,6 +3188,11 @@ set_var_const( goto failed; } var_in_vim9script = is_script_local && current_script_is_vim9(); + if (var_in_vim9script && name[0] == '_' && name[1] == NUL) + { + emsg(_(e_cannot_use_underscore_here)); + goto failed; + } di = find_var_in_ht(ht, 0, varname, TRUE); |