diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2022-11-05 15:30:54 +0800 |
|---|---|---|
| committer | zeertzjq <zeertzjq@outlook.com> | 2022-11-07 08:24:48 +0800 |
| commit | b3e9010f4783a51407ec5a5ad9fda1216d4db3fe (patch) | |
| tree | 9b7fb38eeafcec8a1fc19d13aff75b286f9cc3d9 /src/nvim/testdir | |
| parent | 900dd2bdab85b25237cec638265d44c2174154ed (diff) | |
| download | rneovim-b3e9010f4783a51407ec5a5ad9fda1216d4db3fe.tar.gz rneovim-b3e9010f4783a51407ec5a5ad9fda1216d4db3fe.tar.bz2 rneovim-b3e9010f4783a51407ec5a5ad9fda1216d4db3fe.zip | |
vim-patch:8.2.3705: cannot pass a lambda name to function() or funcref()
Problem: Cannot pass a lambda name to function() or funcref(). (Yegappan
Lakshmanan)
Solution: Handle a lambda name differently.
https://github.com/vim/vim/commit/eba3b7f6645c8f856132b4c06a009a3b0a44e21c
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/test_expr.vim | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_expr.vim b/src/nvim/testdir/test_expr.vim index ea874cc398..9dbc923b96 100644 --- a/src/nvim/testdir/test_expr.vim +++ b/src/nvim/testdir/test_expr.vim @@ -496,6 +496,13 @@ func Test_function_with_funcref() call assert_fails("call function('foo()')", 'E475:') call assert_fails("call function('foo()')", 'foo()') call assert_fails("function('')", 'E129:') + + let Len = {s -> strlen(s)} + call assert_equal(6, Len('foobar')) + let name = string(Len) + " can evaluate "function('<lambda>99')" + call execute('let Ref = ' .. name) + call assert_equal(4, Ref('text')) endfunc func Test_funcref() |