summaryrefslogtreecommitdiffstats
path: root/runtime/doc
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-07-18 18:21:38 +0200
committerBram Moolenaar <Bram@vim.org>2021-07-18 18:21:38 +0200
commit4db572eeb2b42819268e934e76c67163316d873f (patch)
tree7c7b632b8808211dcaecb968090f31aac4e2b13a /runtime/doc
parentad2d4969e1616d3a0354c181e3a09271d5433b3d (diff)
patch 8.2.3178: Vim9: the file name of an :import cannot be an expressionv8.2.3178
Problem: Vim9: the file name of an :import cannot be an expression. Solution: Accept an expression that results in a string. Do not support :import in a function.
Diffstat (limited to 'runtime/doc')
-rw-r--r--runtime/doc/vim9.txt4
1 files changed, 4 insertions, 0 deletions
diff --git a/runtime/doc/vim9.txt b/runtime/doc/vim9.txt
index 8b91cdd4b1..a0681d2875 100644
--- a/runtime/doc/vim9.txt
+++ b/runtime/doc/vim9.txt
@@ -1354,6 +1354,9 @@ script file to avoid confusion.
`:import` can also be used in legacy Vim script. The imported items still
become script-local, even when the "s:" prefix is not given.
+`:import` can not be used in a function. Imported items are intended to exist
+at the script level and only imported once.
+
The script name after `import` can be:
- A relative path, starting "." or "..". This finds a file relative to the
location of the script file itself. This is useful to split up a large
@@ -1363,6 +1366,7 @@ The script name after `import` can be:
- A path not being relative or absolute. This will be found in the
"import" subdirectories of 'runtimepath' entries. The name will usually be
longer and unique, to avoid loading the wrong file.
+ Note that "after/import" is not used.
Once a vim9 script file has been imported, the result is cached and used the
next time the same script is imported. It will not be read again.