diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-04-01 12:57:57 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-04-01 12:57:57 +0200 |
commit | 529fb5a5f62378bbaac00e1ed9b9c32c6e20c1b9 (patch) | |
tree | e1065950c21303ce05a5ababf3812ff00e0bb533 /src/vim9script.c | |
parent | 12be734faffe1da04dfa9098e73abaa864204bc5 (diff) | |
download | vim-git-529fb5a5f62378bbaac00e1ed9b9c32c6e20c1b9.tar.gz |
patch 8.2.2682: Vim9: cannot find Name.Func from "import * as Name"v8.2.2682
Problem: Vim9: cannot find Name.Func from "import * as Name". (Alexander
Goussas)
Solution: When no variable found try finding a function. (closes #8045)
Check that the function was exported.
Diffstat (limited to 'src/vim9script.c')
-rw-r--r-- | src/vim9script.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/vim9script.c b/src/vim9script.c index 9839a06cf..a72ef5509 100644 --- a/src/vim9script.c +++ b/src/vim9script.c @@ -298,8 +298,7 @@ find_exported( svar_T *sv; scriptitem_T *script = SCRIPT_ITEM(sid); - // find name in "script" - // TODO: also find script-local user function + // Find name in "script". idx = get_script_item_idx(sid, name, 0, cctx); if (idx >= 0) { @@ -341,6 +340,13 @@ find_exported( semsg(_(e_item_not_found_in_script_str), name); return -1; } + else if (((*ufunc)->uf_flags & FC_EXPORT) == 0) + { + if (verbose) + semsg(_(e_item_not_exported_in_script_str), name); + *ufunc = NULL; + return -1; + } } return idx; |