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().
diff --git a/src/userfunc.c b/src/userfunc.c
index b5b57ec..467a046 100644
--- a/src/userfunc.c
+++ b/src/userfunc.c
@@ -2388,8 +2388,7 @@
}
// 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 @@
{
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)