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)
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index ee03570..c49b608 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -376,7 +376,8 @@
*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 @@
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