Mercurial > vim
comparison src/evalfunc.c @ 27457:4c16acb2525f v8.2.4257
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Commit: https://github.com/vim/vim/commit/62aec93bfdb9e1b40d03a6d2e8e9511f8b1bdb2d
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jan 29 21:45:34 2022 +0000
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.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 29 Jan 2022 23:00:05 +0100 |
parents | c7f614c9ceb3 |
children | b43f6c879d52 |
comparison
equal
deleted
inserted
replaced
27456:a8e2d91995ce | 27457:4c16acb2525f |
---|---|
3828 if (*skipwhite(p) != NUL) | 3828 if (*skipwhite(p) != NUL) |
3829 n = FALSE; // trailing garbage | 3829 n = FALSE; // trailing garbage |
3830 } | 3830 } |
3831 else if (*p == '*') // internal or user defined function | 3831 else if (*p == '*') // internal or user defined function |
3832 { | 3832 { |
3833 int save_version = current_sctx.sc_version; | |
3834 | |
3835 // Vim9 script assumes a function is script-local, but here we want to | |
3836 // find any matching function. | |
3837 if (current_sctx.sc_version == SCRIPT_VERSION_VIM9) | |
3838 current_sctx.sc_version = SCRIPT_VERSION_MAX; | |
3839 n = function_exists(p + 1, FALSE); | 3833 n = function_exists(p + 1, FALSE); |
3840 current_sctx.sc_version = save_version; | |
3841 } | 3834 } |
3842 else if (*p == '?') // internal function only | 3835 else if (*p == '?') // internal function only |
3843 { | 3836 { |
3844 n = has_internal_func_name(p + 1); | 3837 n = has_internal_func_name(p + 1); |
3845 } | 3838 } |