diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-01-22 20:19:22 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-01-22 20:19:22 +0000 |
commit | 47bcc5f4c83c158f43ac2ea7abfe99dbf5c2e098 (patch) | |
tree | 078894b69ac8ca24d6c9b841c1268b38febd17a5 /src/findfile.c | |
parent | 3ba685eeefcfbbf895d70664357ef05f252d7b21 (diff) |
patch 8.2.4184: cannot use an import in 'includeexpr'v8.2.4184
Problem: Cannot use an import in 'includeexpr'.
Solution: Set the script context when evaluating 'includeexpr'
Diffstat (limited to 'src/findfile.c')
-rw-r--r-- | src/findfile.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/findfile.c b/src/findfile.c index 3a6484574e..e8b3fa656d 100644 --- a/src/findfile.c +++ b/src/findfile.c @@ -2094,11 +2094,16 @@ file_name_in_line( eval_includeexpr(char_u *ptr, int len) { char_u *res; + sctx_T save_sctx = current_sctx; set_vim_var_string(VV_FNAME, ptr, len); + current_sctx = curbuf->b_p_script_ctx[BV_INEX]; + res = eval_to_string_safe(curbuf->b_p_inex, - was_set_insecurely((char_u *)"includeexpr", OPT_LOCAL), FALSE); + was_set_insecurely((char_u *)"includeexpr", OPT_LOCAL), TRUE); + set_vim_var_string(VV_FNAME, NULL, 0); + current_sctx = save_sctx; return res; } # endif |