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.
diff --git a/src/buffer.c b/src/buffer.c
index d8d0f3c..e50b01d 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -4162,7 +4162,7 @@
tv.vval.v_number = wp->w_id;
set_var((char_u *)"g:statusline_winid", &tv, FALSE);
- usefmt = eval_to_string_safe(fmt + 2, use_sandbox);
+ usefmt = eval_to_string_safe(fmt + 2, use_sandbox, FALSE);
if (usefmt == NULL)
usefmt = fmt;
@@ -4546,7 +4546,7 @@
if (curwin != save_curwin)
VIsual_active = FALSE;
- str = eval_to_string_safe(p, use_sandbox);
+ str = eval_to_string_safe(p, use_sandbox, FALSE);
curwin = save_curwin;
curbuf = save_curbuf;