comparison src/eval.c @ 29014:45c182c4f7e9 v8.2.5029

patch 8.2.5029: "textlock" is always zero Commit: https://github.com/vim/vim/commit/cfe456543e840d133399551f8626d985e1fb1958 Author: zeertzjq <zeertzjq@outlook.com> Date: Fri May 27 17:26:55 2022 +0100 patch 8.2.5029: "textlock" is always zero Problem: "textlock" is always zero. Solution: Remove "textlock" and rename "textwinlock" to "textlock". (closes #10489)
author Bram Moolenaar <Bram@vim.org>
date Fri, 27 May 2022 18:30:04 +0200
parents 3043a3e2ef95
children c98fc7a4dde4
comparison
equal deleted inserted replaced
29013:d114ba9c74c2 29014:45c182c4f7e9
541 return eval_to_string_eap(arg, convert, NULL); 541 return eval_to_string_eap(arg, convert, NULL);
542 } 542 }
543 543
544 /* 544 /*
545 * Call eval_to_string() without using current local variables and using 545 * Call eval_to_string() without using current local variables and using
546 * textwinlock. When "use_sandbox" is TRUE use the sandbox. 546 * textlock. When "use_sandbox" is TRUE use the sandbox.
547 * Use legacy Vim script syntax. 547 * Use legacy Vim script syntax.
548 */ 548 */
549 char_u * 549 char_u *
550 eval_to_string_safe( 550 eval_to_string_safe(
551 char_u *arg, 551 char_u *arg,
560 if (!keep_script_version) 560 if (!keep_script_version)
561 current_sctx.sc_version = 1; 561 current_sctx.sc_version = 1;
562 save_funccal(&funccal_entry); 562 save_funccal(&funccal_entry);
563 if (use_sandbox) 563 if (use_sandbox)
564 ++sandbox; 564 ++sandbox;
565 ++textwinlock; 565 ++textlock;
566 may_garbage_collect = FALSE; 566 may_garbage_collect = FALSE;
567 retval = eval_to_string(arg, FALSE); 567 retval = eval_to_string(arg, FALSE);
568 if (use_sandbox) 568 if (use_sandbox)
569 --sandbox; 569 --sandbox;
570 --textwinlock; 570 --textlock;
571 may_garbage_collect = save_garbage; 571 may_garbage_collect = save_garbage;
572 restore_funccal(); 572 restore_funccal();
573 current_sctx.sc_version = save_sc_version; 573 current_sctx.sc_version = save_sc_version;
574 return retval; 574 return retval;
575 } 575 }
805 current_sctx = wp->w_p_script_ctx[WV_FDE]; 805 current_sctx = wp->w_p_script_ctx[WV_FDE];
806 806
807 ++emsg_off; 807 ++emsg_off;
808 if (use_sandbox) 808 if (use_sandbox)
809 ++sandbox; 809 ++sandbox;
810 ++textwinlock; 810 ++textlock;
811 *cp = NUL; 811 *cp = NUL;
812 if (eval0(arg, &tv, NULL, &EVALARG_EVALUATE) == FAIL) 812 if (eval0(arg, &tv, NULL, &EVALARG_EVALUATE) == FAIL)
813 retval = 0; 813 retval = 0;
814 else 814 else
815 { 815 {
830 clear_tv(&tv); 830 clear_tv(&tv);
831 } 831 }
832 --emsg_off; 832 --emsg_off;
833 if (use_sandbox) 833 if (use_sandbox)
834 --sandbox; 834 --sandbox;
835 --textwinlock; 835 --textlock;
836 clear_evalarg(&EVALARG_EVALUATE, NULL); 836 clear_evalarg(&EVALARG_EVALUATE, NULL);
837 current_sctx = saved_sctx; 837 current_sctx = saved_sctx;
838 838
839 return (int)retval; 839 return (int)retval;
840 } 840 }