vim-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 vim/vim#9250)
05e59e3a9f

Omit Vim9 script in code and comment out in tests.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
This commit is contained in:
zeertzjq
2022-08-20 09:35:09 +08:00
parent b3e9010f47
commit 1508618d4c
3 changed files with 108 additions and 15 deletions

View File

@@ -320,7 +320,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