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/eval.c | |
parent | 599410cb3cb19946cd6df22441da5de003e114bb (diff) | |
download | vim-git-962c43bf0d6a33b905f2acd920d3701476ebb5c9.tar.gz |
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/eval.c')
-rw-r--r-- | src/eval.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/eval.c b/src/eval.c index 05b658442..fe9d4ec2e 100644 --- a/src/eval.c +++ b/src/eval.c @@ -3514,7 +3514,12 @@ eval7( { int flags = evalarg == NULL ? 0 : evalarg->eval_flags; - if ((in_vim9script() ? **arg : *skipwhite(*arg)) == '(') + if (in_vim9script() && len == 1 && *s == '_') + { + emsg(_(e_cannot_use_underscore_here)); + ret = FAIL; + } + else if ((in_vim9script() ? **arg : *skipwhite(*arg)) == '(') { // "name(..." recursive! *arg = skipwhite(*arg); |