1
0
forked from aniani/vim

patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent

Problem:    Vim9: finding global function without g: prefix but not finding
            global variable is inconsistent.
Solution:   Require using g: for a global function.  Change the vim9.vim
            script into a Vim9 script with exports.  Fix that import in legacy
            script does not work.
This commit is contained in:
Bram Moolenaar
2022-01-29 21:45:34 +00:00
parent 135e15251e
commit 62aec93bfd
34 changed files with 3212 additions and 3176 deletions

View File

@@ -3830,14 +3830,7 @@ f_exists(typval_T *argvars, typval_T *rettv)
}
else if (*p == '*') // internal or user defined function
{
int save_version = current_sctx.sc_version;
// Vim9 script assumes a function is script-local, but here we want to
// find any matching function.
if (current_sctx.sc_version == SCRIPT_VERSION_VIM9)
current_sctx.sc_version = SCRIPT_VERSION_MAX;
n = function_exists(p + 1, FALSE);
current_sctx.sc_version = save_version;
}
else if (*p == '?') // internal function only
{