0
0
mirror of https://github.com/vim/vim.git synced 2025-10-04 05:25:06 -04:00

patch 8.2.2721: Vim9: cannot have a linebreak inside a lambda

Problem:    Vim9: cannot have a linebreak inside a lambda.
Solution:   Compile the expression before the arguments.
This commit is contained in:
Bram Moolenaar
2021-04-05 19:41:21 +02:00
parent 01ac0a1f66
commit 2927c07b0e
3 changed files with 49 additions and 20 deletions

View File

@@ -2075,16 +2075,14 @@ def Test_expr7_new_lambda()
enddef
def Test_expr7_lambda_vim9script()
# TODO: make this work in a :def function
var lines =<< trim END
vim9script
var v = 10->((a) =>
a
+ 2
)()
assert_equal(12, v)
END
CheckScriptSuccess(lines)
CheckDefAndScriptSuccess(lines)
# nested lambda with line breaks
lines =<< trim END