aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-09-04 06:40:19 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-09-04 18:39:55 +0800
commit6f7d55d3d987560d65220522e3705704abca5325 (patch)
tree109074ff0cfad946ade7ffbf21e21e1d06a0960b
parent24fbda04b9e9537577220e1f5bf7d2934d94191d (diff)
downloadrneovim-6f7d55d3d987560d65220522e3705704abca5325.tar.gz
rneovim-6f7d55d3d987560d65220522e3705704abca5325.tar.bz2
rneovim-6f7d55d3d987560d65220522e3705704abca5325.zip
vim-patch:7.4.{1578,1624}
https://github.com/vim/vim/commit/975b5271eed4fa0500c24a8f37be0b1797cb9db7 https://github.com/vim/vim/commit/03602ec28ed25739e88b2c835adb0662d3720bb2
-rw-r--r--runtime/doc/builtin.txt19
1 files changed, 18 insertions, 1 deletions
diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt
index a2e15142e7..50087db4ea 100644
--- a/runtime/doc/builtin.txt
+++ b/runtime/doc/builtin.txt
@@ -2510,7 +2510,8 @@ funcref({name} [, {arglist}] [, {dict}])
*function()* *E700* *E922* *E923*
function({name} [, {arglist}] [, {dict}])
Return a |Funcref| variable that refers to function {name}.
- {name} can be a user defined function or an internal function.
+ {name} can be the name of a user defined function or an
+ internal function.
{name} can also be a Funcref or a partial. When it is a
partial the dict stored in it will be used and the {dict}
@@ -2536,6 +2537,18 @@ function({name} [, {arglist}] [, {dict}])
< Invokes the function as with: >
call Callback('one', 'two', 'name')
+< The function() call can be nested to add more arguments to the
+ Funcref. The extra arguments are appended to the list of
+ arguments. Example: >
+ func Callback(arg1, arg2, name)
+ ...
+ let Func = function('Callback', ['one'])
+ let Func2 = function(Func, ['two'])
+ ...
+ call Func2('name')
+< Invokes the function as with: >
+ call Callback('one', 'two', 'name')
+
< The Dictionary is only useful when calling a "dict" function.
In that case the {dict} is passed in as "self". Example: >
function Callback() dict
@@ -2546,6 +2559,10 @@ function({name} [, {arglist}] [, {dict}])
let Func = function('Callback', context)
...
call Func() " will echo: called for example
+< The use of function() is not needed when there are no extra
+ arguments, these two are equivalent: >
+ let Func = function('Callback', context)
+ let Func = context.Callback
< The argument list and the Dictionary can be combined: >
function Callback(arg1, count) dict