Mercurial > vim
comparison src/vim9script.c @ 24531:3bfec39ce31c v8.2.2805
patch 8.2.2805: Vim9: cannot use legacy syntax in Vim9 script
Commit: https://github.com/vim/vim/commit/96cf4ba8fb96e5778192d2dab7458b9a7da0a49d
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Apr 24 14:15:41 2021 +0200
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.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 24 Apr 2021 14:30:04 +0200 |
parents | e5db23a8ad98 |
children | 9c404d78d767 |
comparison
equal
deleted
inserted
replaced
24530:51e01f7c2069 | 24531:3bfec39ce31c |
---|---|
25 int | 25 int |
26 in_vim9script(void) | 26 in_vim9script(void) |
27 { | 27 { |
28 // "sc_version" is also set when compiling a ":def" function in legacy | 28 // "sc_version" is also set when compiling a ":def" function in legacy |
29 // script. | 29 // script. |
30 return current_sctx.sc_version == SCRIPT_VERSION_VIM9 | 30 return (current_sctx.sc_version == SCRIPT_VERSION_VIM9 |
31 || (cmdmod.cmod_flags & CMOD_VIM9CMD); | 31 || (cmdmod.cmod_flags & CMOD_VIM9CMD)) |
32 && !(cmdmod.cmod_flags & CMOD_LEGACY); | |
32 } | 33 } |
33 | 34 |
34 #if defined(FEAT_EVAL) || defined(PROTO) | 35 #if defined(FEAT_EVAL) || defined(PROTO) |
35 /* | 36 /* |
36 * Return TRUE if the current script is Vim9 script. | 37 * Return TRUE if the current script is Vim9 script. |