diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-05-15 20:06:58 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-05-15 20:06:58 +0200 |
commit | 0820f4de5872bfbdc25bf6cba6ec5646dbcec156 (patch) | |
tree | 1025fd74d4fc5c3266a4f9fe93ee61ef0f61aadb /src/eval.c | |
parent | 30e3de21fc36153c5f7c9cf9db90bcc60dd67fb9 (diff) |
patch 8.2.2855: white space after "->" does not give E274v8.2.2855
Problem: White space after "->" does not give E274.
Solution: Do not skip white space in legacy script. (closes #8212)
Diffstat (limited to 'src/eval.c')
-rw-r--r-- | src/eval.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/eval.c b/src/eval.c index 0d4f5fe59c..97c5f78dff 100644 --- a/src/eval.c +++ b/src/eval.c @@ -5916,10 +5916,18 @@ handle_subscript( } else if (p[0] == '-' && p[1] == '>') { - *arg = skipwhite(p + 2); + if (in_vim9script()) + *arg = skipwhite(p + 2); + else + *arg = p + 2; if (ret == OK) { - if ((**arg == '{' && !in_vim9script()) || **arg == '(') + if (VIM_ISWHITE(**arg)) + { + emsg(_(e_nowhitespace)); + ret = FAIL; + } + else if ((**arg == '{' && !in_vim9script()) || **arg == '(') // expr->{lambda}() or expr->(lambda)() ret = eval_lambda(arg, rettv, evalarg, verbose); else |