patch 8.2.2511: Vim9: cannot use Vim9 script syntax in some places
Problem: Vim9: cannot use Vim9 script syntax in some places.
Solution: Add the :vim9cmd command modifier. Incompatible: Makes ":vim9"
mean ":vim9cmd" instead of ":vim9script".
This commit is contained in:
@ -51,6 +51,7 @@ The Vim9 script syntax and semantics are used in:
|
||||
- a function defined with the `:def` command
|
||||
- a script file where the first command is `vim9script`
|
||||
- an autocommand defined in the context of the above
|
||||
- a command prefixed with the `vim9cmd` command modifier
|
||||
|
||||
When using `:function` in a Vim9 script file the legacy syntax is used, with
|
||||
the highest |scriptversion|. However, this can be confusing and is therefore
|
||||
@ -60,6 +61,12 @@ 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}
|
||||
Execute {cmd} using Vim9 script syntax and semantics.
|
||||
Useful when typing a command and in a legacy script or
|
||||
function.
|
||||
|
||||
==============================================================================
|
||||
|
||||
2. Differences from legacy Vim script *vim9-differences*
|
||||
|
||||
Reference in New Issue
Block a user