summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-04-24 14:15:41 +0200
committerBram Moolenaar <Bram@vim.org>2021-04-24 14:15:41 +0200
commit96cf4ba8fb96e5778192d2dab7458b9a7da0a49d (patch)
tree13f60474468dc98fcfd1173a94d3614b438e1278 /runtime
parent7ba1e4d363164e32a93cceab64b42e8c6d89e9f3 (diff)
patch 8.2.2805: Vim9: cannot use legacy syntax in Vim9 scriptv8.2.2805
Problem: Vim9: cannot use legacy syntax in Vim9 script. Solution: Add the :legacy command.
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/index.txt1
-rw-r--r--runtime/doc/vim9.txt9
2 files changed, 8 insertions, 2 deletions
diff --git a/runtime/doc/index.txt b/runtime/doc/index.txt
index 7da806691e..f0e8f30fae 100644
--- a/runtime/doc/index.txt
+++ b/runtime/doc/index.txt
@@ -1396,6 +1396,7 @@ tag command action ~
|:lfdo| :lfd[o] execute command in each file in location list
|:left| :le[ft] left align lines
|:leftabove| :lefta[bove] make split window appear left or above
+|:legacy| :leg[acy] make following command use legacy script syntax
|:let| :let assign a value to a variable or option
|:lexpr| :lex[pr] read locations from expr and jump to first
|:lfile| :lf[ile] read file with locations and jump to first
diff --git a/runtime/doc/vim9.txt b/runtime/doc/vim9.txt
index 0fc7bf5278..0a2ea62952 100644
--- a/runtime/doc/vim9.txt
+++ b/runtime/doc/vim9.txt
@@ -61,12 +61,17 @@ Vim9 script and legacy Vim script can be mixed. There is no requirement to
rewrite old scripts, they keep working as before. You may want to use a few
`:def` functions for code that needs to be fast.
- *:vim9* *:vim9cmd*
-:vim9[cmd] {cmd}
+:vim9[cmd] {cmd} *:vim9* *:vim9cmd*
Execute {cmd} using Vim9 script syntax and semantics.
Useful when typing a command and in a legacy script or
function.
+:leg[acy] {cmd} *:leg* *:legacy*
+ Execute {cmd} using legacy script syntax and semantics. Only
+ useful in a Vim9 script or a :def function.
+ Note that {cmd} cannot use local variables, since it is parsed
+ with legacy expression syntax.
+
==============================================================================
2. Differences from legacy Vim script *vim9-differences*