0
0
mirror of https://github.com/vim/vim.git synced 2025-10-14 07:04:10 -04:00

patch 8.2.4184: cannot use an import in 'includeexpr'

Problem:    Cannot use an import in 'includeexpr'.
Solution:   Set the script context when evaluating 'includeexpr'
This commit is contained in:
Bram Moolenaar
2022-01-22 20:19:22 +00:00
parent 3ba685eeef
commit 47bcc5f4c8
3 changed files with 38 additions and 1 deletions

View File

@@ -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