comparison src/eval.c @ 20229:06a1dd50463e v8.2.0670

patch 8.2.0670: cannot change window when evaluating 'completefunc' Commit: https://github.com/vim/vim/commit/6adb9ea0a6ca01414f4b591f379b0f829a8273c0 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Apr 30 22:31:18 2020 +0200 patch 8.2.0670: cannot change window when evaluating 'completefunc' Problem: Cannot change window when evaluating 'completefunc'. Solution: Make a difference between not changing text or buffers and also not changing window.
author Bram Moolenaar <Bram@vim.org>
date Thu, 30 Apr 2020 22:45:04 +0200
parents 94f05de75e9f
children 683c2da4982b
comparison
equal deleted inserted replaced
20228:4fb1da5a5031 20229:06a1dd50463e
391 return retval; 391 return retval;
392 } 392 }
393 393
394 /* 394 /*
395 * Call eval_to_string() without using current local variables and using 395 * Call eval_to_string() without using current local variables and using
396 * textlock. When "use_sandbox" is TRUE use the sandbox. 396 * textwinlock. When "use_sandbox" is TRUE use the sandbox.
397 */ 397 */
398 char_u * 398 char_u *
399 eval_to_string_safe( 399 eval_to_string_safe(
400 char_u *arg, 400 char_u *arg,
401 char_u **nextcmd, 401 char_u **nextcmd,
405 funccal_entry_T funccal_entry; 405 funccal_entry_T funccal_entry;
406 406
407 save_funccal(&funccal_entry); 407 save_funccal(&funccal_entry);
408 if (use_sandbox) 408 if (use_sandbox)
409 ++sandbox; 409 ++sandbox;
410 ++textlock; 410 ++textwinlock;
411 retval = eval_to_string(arg, nextcmd, FALSE); 411 retval = eval_to_string(arg, nextcmd, FALSE);
412 if (use_sandbox) 412 if (use_sandbox)
413 --sandbox; 413 --sandbox;
414 --textlock; 414 --textwinlock;
415 restore_funccal(); 415 restore_funccal();
416 return retval; 416 return retval;
417 } 417 }
418 418
419 /* 419 /*
574 OPT_LOCAL); 574 OPT_LOCAL);
575 575
576 ++emsg_off; 576 ++emsg_off;
577 if (use_sandbox) 577 if (use_sandbox)
578 ++sandbox; 578 ++sandbox;
579 ++textlock; 579 ++textwinlock;
580 *cp = NUL; 580 *cp = NUL;
581 if (eval0(arg, &tv, NULL, TRUE) == FAIL) 581 if (eval0(arg, &tv, NULL, TRUE) == FAIL)
582 retval = 0; 582 retval = 0;
583 else 583 else
584 { 584 {
599 clear_tv(&tv); 599 clear_tv(&tv);
600 } 600 }
601 --emsg_off; 601 --emsg_off;
602 if (use_sandbox) 602 if (use_sandbox)
603 --sandbox; 603 --sandbox;
604 --textlock; 604 --textwinlock;
605 605
606 return (int)retval; 606 return (int)retval;
607 } 607 }
608 #endif 608 #endif
609 609