diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-01-23 13:44:35 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-01-23 13:44:35 +0000 |
commit | 7ef4a2fe3736bbeb5bad182782a74576aa06b0db (patch) | |
tree | 082731e347d8841572fb8644dacd03506180984b /src/evalvars.c | |
parent | e15ebeffb35da4bb7d9054358671735ce6988c28 (diff) | |
download | vim-git-7ef4a2fe3736bbeb5bad182782a74576aa06b0db.tar.gz |
patch 8.2.4192: cannot use an import in 'printexpr'v8.2.4192
Problem: Cannot use an import in 'printexpr'.
Solution: Set the script context when evaluating 'printexpr'.
Diffstat (limited to 'src/evalvars.c')
-rw-r--r-- | src/evalvars.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/evalvars.c b/src/evalvars.c index 7578378b3..196d4d422 100644 --- a/src/evalvars.c +++ b/src/evalvars.c @@ -391,13 +391,21 @@ eval_charconvert( eval_printexpr(char_u *fname, char_u *args) { int err = FALSE; + sctx_T saved_sctx = current_sctx; + sctx_T *ctx; set_vim_var_string(VV_FNAME_IN, fname, -1); set_vim_var_string(VV_CMDARG, args, -1); + ctx = get_option_sctx("printexpr"); + if (ctx != NULL) + current_sctx = *ctx; + if (eval_to_bool(p_pexpr, &err, NULL, FALSE)) err = TRUE; + set_vim_var_string(VV_FNAME_IN, NULL, -1); set_vim_var_string(VV_CMDARG, NULL, -1); + current_sctx = saved_sctx; if (err) { |