1
0
forked from aniani/vim

patch 8.2.1190: Vim9: checking for Vim9 syntax is spread out

Problem:    Vim9: checking for Vim9 syntax is spread out.
Solution:   Use in_vim9script().
This commit is contained in:
Bram Moolenaar
2020-07-12 17:07:05 +02:00
parent 8af81d656a
commit eb6880b6eb
9 changed files with 26 additions and 28 deletions

View File

@@ -2388,8 +2388,7 @@ trans_function_name(
}
// In Vim9 script a user function is script-local by default.
vim9script = ASCII_ISUPPER(*start)
&& current_sctx.sc_version == SCRIPT_VERSION_VIM9;
vim9script = ASCII_ISUPPER(*start) && in_vim9script();
/*
* Copy the function name to allocated memory.
@@ -2469,7 +2468,7 @@ untrans_function_name(char_u *name)
{
char_u *p;
if (*name == K_SPECIAL && current_sctx.sc_version == SCRIPT_VERSION_VIM9)
if (*name == K_SPECIAL && in_vim9script())
{
p = vim_strchr(name, '_');
if (p != NULL)