diff runtime/doc/vim9.txt @ 25282:9bce044c7643 v8.2.3178

patch 8.2.3178: Vim9: the file name of an :import cannot be an expression Commit: https://github.com/vim/vim/commit/4db572eeb2b42819268e934e76c67163316d873f Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jul 18 18:21:38 2021 +0200 patch 8.2.3178: Vim9: the file name of an :import cannot be an expression 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.
author Bram Moolenaar <Bram@vim.org>
date Sun, 18 Jul 2021 18:30:04 +0200
parents 84c7dc0fdcd2
children bdda48f01a68
line wrap: on
line diff
--- 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.