summaryrefslogtreecommitdiff
path: root/src/vim9script.c
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 /src/vim9script.c
parent7ba1e4d363164e32a93cceab64b42e8c6d89e9f3 (diff)
downloadvim-git-96cf4ba8fb96e5778192d2dab7458b9a7da0a49d.tar.gz
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 'src/vim9script.c')
-rw-r--r--src/vim9script.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/vim9script.c b/src/vim9script.c
index 583a8d4c5..ddbae781c 100644
--- a/src/vim9script.c
+++ b/src/vim9script.c
@@ -27,8 +27,9 @@ in_vim9script(void)
{
// "sc_version" is also set when compiling a ":def" function in legacy
// script.
- return current_sctx.sc_version == SCRIPT_VERSION_VIM9
- || (cmdmod.cmod_flags & CMOD_VIM9CMD);
+ return (current_sctx.sc_version == SCRIPT_VERSION_VIM9
+ || (cmdmod.cmod_flags & CMOD_VIM9CMD))
+ && !(cmdmod.cmod_flags & CMOD_LEGACY);
}
#if defined(FEAT_EVAL) || defined(PROTO)