summaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorYegappan Lakshmanan <yegappan@yahoo.com>2021-12-06 11:03:55 +0000
committerBram Moolenaar <Bram@vim.org>2021-12-06 11:03:55 +0000
commit6409553b6e3b4de4e1d72b8ee5445595214581ff (patch)
tree1b24d5f956763a1bc7a5b47fc9875598d0d438d6 /runtime
parent40bcec1bac34d34a3d4d7c5f6b2cc1f163acbd00 (diff)
downloadvim-git-6409553b6e3b4de4e1d72b8ee5445595214581ff.tar.gz
patch 8.2.3751: cannot assign a lambda to an option that takes a functionv8.2.3751
Problem: Cannot assign a lambda to an option that takes a function. Solution: Automatically convert the lambda to a string. (Yegappan Lakshmanan, closes #9286)
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/options.txt7
1 files changed, 4 insertions, 3 deletions
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index ee03570ba..c49b60824 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -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