summaryrefslogtreecommitdiffstats
path: root/runtime/doc/vim9.txt
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-02-26 12:25:45 +0000
committerBram Moolenaar <Bram@vim.org>2022-02-26 12:25:45 +0000
commitc51cf0329809c7ae946c59d6f56699227efc9d1b (patch)
tree825302ef0857905dbf08dc584ef6d6a8aae27790 /runtime/doc/vim9.txt
parente41c1dd8890d3f701253255993f4e9af2d12225c (diff)
Update runtime files.
Diffstat (limited to 'runtime/doc/vim9.txt')
-rw-r--r--runtime/doc/vim9.txt15
1 files changed, 12 insertions, 3 deletions
diff --git a/runtime/doc/vim9.txt b/runtime/doc/vim9.txt
index a5bcb3f443..385238bfb1 100644
--- a/runtime/doc/vim9.txt
+++ b/runtime/doc/vim9.txt
@@ -1,4 +1,4 @@
-*vim9.txt* For Vim version 8.2. Last change: 2022 Feb 22
+*vim9.txt* For Vim version 8.2. Last change: 2022 Feb 23
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -229,8 +229,17 @@ script "export" needs to be used. >
< *E1058* *E1075*
When using `:function` or `:def` to specify a nested function inside a `:def`
function and no namespace was given, this nested function is local to the code
-block it is defined in. It is not possible to define a script-local function.
-It is possible to define a global function by using the "g:" prefix.
+block it is defined in. It cannot be used in `function()` with a string
+argument, pass the function reference itself: >
+ def Outer()
+ def Inner()
+ echo 'inner'
+ enddef
+ var Fok = function(Inner) # OK
+ var Fbad = function('Inner') # does not work
+
+It is not possible to define a script-local function. It is possible to
+define a global function by using the "g:" prefix.
When referring to a function and no "s:" or "g:" prefix is used, Vim will
search for the function: