comparison src/buffer.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 841145bb9885
children 41e0dcf38521
comparison
equal deleted inserted replaced
27300:160b87e56c45 27301:ebe56a24acb6
4160 4160
4161 tv.v_type = VAR_NUMBER; 4161 tv.v_type = VAR_NUMBER;
4162 tv.vval.v_number = wp->w_id; 4162 tv.vval.v_number = wp->w_id;
4163 set_var((char_u *)"g:statusline_winid", &tv, FALSE); 4163 set_var((char_u *)"g:statusline_winid", &tv, FALSE);
4164 4164
4165 usefmt = eval_to_string_safe(fmt + 2, use_sandbox); 4165 usefmt = eval_to_string_safe(fmt + 2, use_sandbox, FALSE);
4166 if (usefmt == NULL) 4166 if (usefmt == NULL)
4167 usefmt = fmt; 4167 usefmt = fmt;
4168 4168
4169 do_unlet((char_u *)"g:statusline_winid", TRUE); 4169 do_unlet((char_u *)"g:statusline_winid", TRUE);
4170 } 4170 }
4544 curbuf = wp->w_buffer; 4544 curbuf = wp->w_buffer;
4545 // Visual mode is only valid in the current window. 4545 // Visual mode is only valid in the current window.
4546 if (curwin != save_curwin) 4546 if (curwin != save_curwin)
4547 VIsual_active = FALSE; 4547 VIsual_active = FALSE;
4548 4548
4549 str = eval_to_string_safe(p, use_sandbox); 4549 str = eval_to_string_safe(p, use_sandbox, FALSE);
4550 4550
4551 curwin = save_curwin; 4551 curwin = save_curwin;
4552 curbuf = save_curbuf; 4552 curbuf = save_curbuf;
4553 VIsual_active = save_VIsual_active; 4553 VIsual_active = save_VIsual_active;
4554 do_unlet((char_u *)"g:actual_curbuf", TRUE); 4554 do_unlet((char_u *)"g:actual_curbuf", TRUE);