mirror of
https://github.com/zoriya/vim.git
synced 2026-06-01 03:08:27 +00:00
patch 8.2.3751: cannot assign a lambda to an option that takes a function
Problem: Cannot assign a lambda to an option that takes a function.
Solution: Automatically convert the lambda to a string. (Yegappan
Lakshmanan, closes #9286)
This commit is contained in:
committed by
Bram Moolenaar
parent
40bcec1bac
commit
6409553b6e
@@ -376,7 +376,8 @@ Note: In the future more global options can be made global-local. Using
|
||||
*option-value-function*
|
||||
Some options ('completefunc', 'imactivatefunc', 'imstatusfunc', 'omnifunc',
|
||||
'operatorfunc', 'quickfixtextfunc', 'tagfunc' and 'thesaurusfunc') are set to
|
||||
a function name or a function reference or a lambda function. Examples:
|
||||
a function name or a function reference or a lambda function. When using a
|
||||
lambda it will be converted to the name, e.g. "<lambda>123". Examples:
|
||||
>
|
||||
set opfunc=MyOpFunc
|
||||
set opfunc=function('MyOpFunc')
|
||||
@@ -386,10 +387,10 @@ a function name or a function reference or a lambda function. Examples:
|
||||
let Fn = function('MyTagFunc')
|
||||
let &tagfunc = string(Fn)
|
||||
" set using a lambda expression
|
||||
let &tagfunc = "{t -> MyTagFunc(t)}"
|
||||
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)
|
||||
let &tagfunc = L
|
||||
<
|
||||
|
||||
Setting the filetype
|
||||
|
||||
Reference in New Issue
Block a user