1
0
forked from aniani/vim

patch 8.2.2322: Vim9: closure nested limiting to one level

Problem:    Vim9: closure nested limiting to one level.
Solution:   Add outer_T.  Also make STOREOUTER work.
This commit is contained in:
Bram Moolenaar
2021-01-10 18:33:11 +01:00
parent ab360526ef
commit 0186e58639
5 changed files with 156 additions and 129 deletions

View File

@@ -1822,6 +1822,13 @@ def Test_nested_closure_using_argument()
assert_equal(['x', 'x2'], DoFilterThis('x'))
enddef
def Test_triple_nested_closure()
var what = 'x'
var Match = (val: string, cmp: string): bool => stridx(val, cmp) == 0
var Filter = (l) => filter(l, (_, v) => Match(v, what))
assert_equal(['x', 'x2'], ['x', 'y', 'a', 'x2', 'c']->Filter())
enddef
func Test_silent_echo()
CheckScreendump