0
0
mirror of https://github.com/vim/vim.git synced 2025-10-18 07:54:29 -04:00

patch 8.2.0679: Vim9: incomplete support for closures

Problem:    Vim9: incomplete support for closures.
Solution:   At the end of a function copy arguments and local variables if
            they are still used by a referenced closure.
This commit is contained in:
Bram Moolenaar
2020-05-02 17:52:42 +02:00
parent d58a662f44
commit bf67ea1af0
6 changed files with 261 additions and 66 deletions

View File

@@ -650,4 +650,16 @@ def Test_closure_simple()
assert_equal('some more', RefFunc({s -> local .. s}))
enddef
def MakeRef()
let local = 'some '
g:Ref = {s -> local .. s}
enddef
def Test_closure_ref_after_return()
MakeRef()
assert_equal('some thing', g:Ref('thing'))
unlet g:Ref
enddef
" vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker