1
0
forked from aniani/vim

patch 8.2.2316: Vim9: cannot list a lambda function

Problem:    Vim9: cannot list a lambda function.
Solution:   Support the <lambda>9 notation, like :disassemble. (closes #7634)
This commit is contained in:
Bram Moolenaar
2021-01-08 22:24:19 +01:00
parent 832ea89ca9
commit b657198cb3
3 changed files with 21 additions and 1 deletions

View File

@@ -1802,6 +1802,16 @@ def Test_line_continuation_in_lambda()
Line_continuation_in_lambda()->assert_equal(['D', 'C', 'B', 'A'])
enddef
def Test_list_lambda()
timer_start(1000, (_) => 0)
var body = execute(timer_info()[0].callback
->string()
->substitute("('", ' ', '')
->substitute("')", '', '')
->substitute('function\zs', ' ', ''))
assert_match('def <lambda>\d\+(_: any, ...): number\n1 return 0\n enddef', body)
enddef
func Test_silent_echo()
CheckScreendump