Mercurial > vim
comparison src/eval.c @ 27301:ebe56a24acb6 v8.2.4179
patch 8.2.4179: 'foldtext' is evaluated in the current script context
Commit: https://github.com/vim/vim/commit/9530b580a7b71960dbbdb2b12a3aafeb540bd135
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jan 22 13:39:08 2022 +0000
patch 8.2.4179: 'foldtext' is evaluated in the current script context
Problem: 'foldtext' is evaluated in the current script context.
Solution: Use the script context where the option was set.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 22 Jan 2022 14:45:02 +0100 |
parents | e11682ba8c80 |
children | 84682ad16c31 |
comparison
equal
deleted
inserted
replaced
27300:160b87e56c45 | 27301:ebe56a24acb6 |
---|---|
553 * Use legacy Vim script syntax. | 553 * Use legacy Vim script syntax. |
554 */ | 554 */ |
555 char_u * | 555 char_u * |
556 eval_to_string_safe( | 556 eval_to_string_safe( |
557 char_u *arg, | 557 char_u *arg, |
558 int use_sandbox) | 558 int use_sandbox, |
559 int keep_script_version) | |
559 { | 560 { |
560 char_u *retval; | 561 char_u *retval; |
561 funccal_entry_T funccal_entry; | 562 funccal_entry_T funccal_entry; |
562 int save_sc_version = current_sctx.sc_version; | 563 int save_sc_version = current_sctx.sc_version; |
563 int save_garbage = may_garbage_collect; | 564 int save_garbage = may_garbage_collect; |
564 | 565 |
565 current_sctx.sc_version = 1; | 566 if (!keep_script_version) |
567 current_sctx.sc_version = 1; | |
566 save_funccal(&funccal_entry); | 568 save_funccal(&funccal_entry); |
567 if (use_sandbox) | 569 if (use_sandbox) |
568 ++sandbox; | 570 ++sandbox; |
569 ++textwinlock; | 571 ++textwinlock; |
570 may_garbage_collect = FALSE; | 572 may_garbage_collect = FALSE; |