patch 8.2.3965: Vim9: no easy way to check if Vim9 script is supported

Problem:    Vim9: no easy way to check if Vim9 script is supported.
Solution:   Add has('vim9script').
This commit is contained in:
Bram Moolenaar
2022-01-01 12:17:00 +00:00
parent 654b729c4c
commit b79ee0c299
4 changed files with 22 additions and 5 deletions

View File

@ -391,8 +391,8 @@ later. Example: >
endif
enddef
If you would do it like this you get an error at compile time that
"PluginFunc" does not exist, even when "g:loaded_plugin" does not exist: >
If you do it like this, you get an error at compile time that "PluginFunc"
does not exist, even when "g:loaded_plugin" does not exist: >
def CallPluginFunc()
if exists('g:loaded_plugin')
PluginFunc() # Error - function not found
@ -1411,9 +1411,6 @@ This can only work in two ways:
2. The "if" statement evaluates to true, the commands up to `endif` are
executed and `finish` bails out before reaching `vim9script`.
TODO: The "vim9script" feature does not exist yet, it will only be added once
the Vim9 script syntax has been fully implemented.
Export ~
*:export* *:exp*