0
0
mirror of https://github.com/vim/vim.git synced 2025-10-27 09:24:23 -04:00

patch 9.0.0799: in compiled function ->() on next line not recognized

Problem:    In compiled function ->() on next line not recognized.
Solution:   Also check for "(". (closes #11405)
This commit is contained in:
Bram Moolenaar
2022-10-19 18:04:49 +01:00
parent 3c708c4390
commit d0fbb41eaa
3 changed files with 22 additions and 2 deletions

View File

@@ -82,6 +82,23 @@ func Test_lambda_vim9cmd_linebreak()
call v9.CheckDefAndScriptSuccess(lines)
endfunc
def Test_lamba_compiled_linebreak()
var lines =<< trim END
vim9script
def Echo(what: any)
assert_equal('hello world', what)
enddef
def That()
printf("hello ")
->((x) => x .. "world")()
->Echo()
enddef
That()
END
v9.CheckScriptSuccess(lines)
enddef
func Test_lambda_with_partial()
let l:Cb = function({... -> ['zero', a:1, a:2, a:3]}, ['one', 'two'])
call assert_equal(['zero', 'one', 'two', 'three'], l:Cb('three'))