patch 8.2.3712: cannot use Vim9 lambda for 'tagfunc'

Problem:    Cannot use Vim9 lambda for 'tagfunc'.
Solution:   Make it work, add more tests. (Yegappan Lakshmanan, closes #9250)
This commit is contained in:
Yegappan Lakshmanan
2021-12-01 10:30:07 +00:00
committed by Bram Moolenaar
parent 56a8ffdb6e
commit 05e59e3a9f
5 changed files with 114 additions and 18 deletions

View File

@ -379,7 +379,15 @@ or a function reference or a lambda function. Examples:
set opfunc=MyOpFunc
set opfunc=function('MyOpFunc')
set opfunc=funcref('MyOpFunc')
let &opfunc = "{t -> MyOpFunc(t)}"
set opfunc={a\ ->\ MyOpFunc(a)}
" set using a funcref variable
let Fn = function('MyTagFunc')
let &tagfunc = string(Fn)
" set using a lambda expression
let &tagfunc = "{t -> MyTagFunc(t)}"
" set using a variable with lambda expression
let L = {a, b, c -> MyTagFunc(a, b , c)}
let &tagfunc = string(L)
<
Setting the filetype