From 96451e7f606947c33b11ca024fa76dedf47314b1 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 17 Apr 2023 15:22:54 +0800 Subject: vim-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' https://github.com/vim/vim/commit/47bcc5f4c83c158f43ac2ea7abfe99dbf5c2e098 Co-authored-by: Bram Moolenaar --- src/nvim/path.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/nvim') diff --git a/src/nvim/path.c b/src/nvim/path.c index 137a8da2bc..cf7cd98829 100644 --- a/src/nvim/path.c +++ b/src/nvim/path.c @@ -1661,10 +1661,15 @@ void simplify_filename(char *filename) static char *eval_includeexpr(const char *const ptr, const size_t len) { + const sctx_T save_sctx = current_sctx; set_vim_var_string(VV_FNAME, ptr, (ptrdiff_t)len); + current_sctx = curbuf->b_p_script_ctx[BV_INEX].script_ctx; + char *res = eval_to_string_safe(curbuf->b_p_inex, was_set_insecurely(curwin, "includeexpr", OPT_LOCAL)); + set_vim_var_string(VV_FNAME, NULL, 0); + current_sctx = save_sctx; return res; } -- cgit