0
0
mirror of https://github.com/vim/vim.git synced 2025-09-30 04:44:14 -04:00

patch 8.2.1071: Vim9: no line break allowed inside a lambda

Problem:    Vim9: no line break allowed inside a lambda.
Solution:   Handle line break inside a lambda in Vim9 script.
This commit is contained in:
Bram Moolenaar
2020-06-27 18:06:45 +02:00
parent ab19d495fd
commit e40fbc2ca9
12 changed files with 160 additions and 56 deletions

View File

@@ -1017,6 +1017,18 @@ def Test_expr7_lambda()
assert_equal([1, 3, 5], [1, 2, 3]->map({key, val -> key + val}))
enddef
def Test_expr7_lambda_vim9script()
let lines =<< trim END
vim9script
let v = 10->{a ->
a
+ 2
}()
assert_equal(12, v)
END
CheckScriptSuccess(lines)
enddef
def Test_expr7_dict()
" dictionary
assert_equal(g:dict_empty, {})