From eb6880b6eb7c4631f6103575c0d1336b149348c1 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 12 Jul 2020 17:07:05 +0200 Subject: 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(). --- src/userfunc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/userfunc.c') diff --git a/src/userfunc.c b/src/userfunc.c index b5b57ec88..467a04601 100644 --- a/src/userfunc.c +++ b/src/userfunc.c @@ -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) -- cgit v1.2.1