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'
diff --git a/src/findfile.c b/src/findfile.c
index 3a64845..e8b3fa6 100644
--- a/src/findfile.c
+++ b/src/findfile.c
@@ -2094,11 +2094,16 @@
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