neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit 96451e7f606947c33b11ca024fa76dedf47314b1
parent 36f1e9824aaccfe7211388737aba1bdb0e37e0be
Author: zeertzjq <zeertzjq@outlook.com>
Date:   Mon, 17 Apr 2023 15:22:54 +0800

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>

Diffstat:
Msrc/nvim/path.c | 5+++++
1 file changed, 5 insertions(+), 0 deletions(-)

diff --git 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; }