aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-04-17 15:22:54 +0800
committerzeertzjq <zeertzjq@outlook.com>2023-04-17 15:46:24 +0800
commit96451e7f606947c33b11ca024fa76dedf47314b1 (patch)
tree012ce1e8f39e88d3bfb73c8bc4109ff3852d3688
parent36f1e9824aaccfe7211388737aba1bdb0e37e0be (diff)
downloadrneovim-96451e7f606947c33b11ca024fa76dedf47314b1.tar.gz
rneovim-96451e7f606947c33b11ca024fa76dedf47314b1.tar.bz2
rneovim-96451e7f606947c33b11ca024fa76dedf47314b1.zip
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 <Bram@vim.org>
-rw-r--r--src/nvim/path.c5
1 files changed, 5 insertions, 0 deletions
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;
}