From 96cf4ba8fb96e5778192d2dab7458b9a7da0a49d Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 24 Apr 2021 14:15:41 +0200 Subject: patch 8.2.2805: Vim9: cannot use legacy syntax in Vim9 script Problem: Vim9: cannot use legacy syntax in Vim9 script. Solution: Add the :legacy command. --- runtime/doc/index.txt | 1 + runtime/doc/vim9.txt | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'runtime') diff --git a/runtime/doc/index.txt b/runtime/doc/index.txt index 7da806691..f0e8f30fa 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 0fc7bf527..0a2ea6295 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* -- cgit v1.2.1