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:
@@ -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
|
||||
|
Reference in New Issue
Block a user