diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-01-22 13:39:08 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-01-22 13:39:08 +0000 |
commit | 9530b580a7b71960dbbdb2b12a3aafeb540bd135 (patch) | |
tree | 5e169ea9710cf9d3e1f9dade5ff223c2850a7d59 /src/eval.c | |
parent | 0bfa84916d110d4f4d863e91e144ff05ba431316 (diff) |
patch 8.2.4179: 'foldtext' is evaluated in the current script contextv8.2.4179
Problem: 'foldtext' is evaluated in the current script context.
Solution: Use the script context where the option was set.
Diffstat (limited to 'src/eval.c')
-rw-r--r-- | src/eval.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/eval.c b/src/eval.c index ec34ef13e2..2ca3377492 100644 --- a/src/eval.c +++ b/src/eval.c @@ -555,14 +555,16 @@ eval_to_string( char_u * eval_to_string_safe( char_u *arg, - int use_sandbox) + int use_sandbox, + int keep_script_version) { char_u *retval; funccal_entry_T funccal_entry; int save_sc_version = current_sctx.sc_version; int save_garbage = may_garbage_collect; - current_sctx.sc_version = 1; + if (!keep_script_version) + current_sctx.sc_version = 1; save_funccal(&funccal_entry); if (use_sandbox) ++sandbox; |