Mercurial > vim
diff src/userfunc.c @ 21279:8d1d11afd8c8 v8.2.1190
patch 8.2.1190: Vim9: checking for Vim9 syntax is spread out
Commit: https://github.com/vim/vim/commit/eb6880b6eb7c4631f6103575c0d1336b149348c1
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jul 12 17:07:05 2020 +0200
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().
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 12 Jul 2020 17:15:03 +0200 |
parents | 71bd2f9adb61 |
children | e641f678bdb9 |
line wrap: on
line diff
--- 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)