Mercurial > vim
comparison src/testing.c @ 22742:f7f2d73ff85e v8.2.1919
patch 8.2.1919: assert_fails() setting emsg_silent changes normal execution
Commit: https://github.com/vim/vim/commit/28ee892ac4197421b3317f195512ca64cc56a5b4
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Oct 28 20:20:00 2020 +0100
patch 8.2.1919: assert_fails() setting emsg_silent changes normal execution
Problem: Assert_fails() setting emsg_silent changes normal execution.
Solution: Use a separate flag in_assert_fails.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 28 Oct 2020 20:30:04 +0100 |
parents | a607f02fd17a |
children | 2d05dd71aac3 |
comparison
equal
deleted
inserted
replaced
22741:8c4ba2a7a44f | 22742:f7f2d73ff85e |
---|---|
553 char *wrong_arg_msg = NULL; | 553 char *wrong_arg_msg = NULL; |
554 | 554 |
555 // trylevel must be zero for a ":throw" command to be considered failed | 555 // trylevel must be zero for a ":throw" command to be considered failed |
556 trylevel = 0; | 556 trylevel = 0; |
557 suppress_errthrow = TRUE; | 557 suppress_errthrow = TRUE; |
558 emsg_silent = TRUE; | 558 in_assert_fails = TRUE; |
559 emsg_assert_fails_used = TRUE; | |
560 | 559 |
561 do_cmdline_cmd(cmd); | 560 do_cmdline_cmd(cmd); |
562 if (called_emsg == called_emsg_before) | 561 if (called_emsg == called_emsg_before) |
563 { | 562 { |
564 prepare_assert_error(&ga); | 563 prepare_assert_error(&ga); |
677 } | 676 } |
678 | 677 |
679 theend: | 678 theend: |
680 trylevel = save_trylevel; | 679 trylevel = save_trylevel; |
681 suppress_errthrow = FALSE; | 680 suppress_errthrow = FALSE; |
682 emsg_silent = FALSE; | 681 in_assert_fails = FALSE; |
682 did_emsg = FALSE; | |
683 msg_col = 0; | |
684 need_wait_return = FALSE; | |
683 emsg_on_display = FALSE; | 685 emsg_on_display = FALSE; |
684 emsg_assert_fails_used = FALSE; | 686 msg_scrolled = 0; |
687 lines_left = Rows; | |
685 VIM_CLEAR(emsg_assert_fails_msg); | 688 VIM_CLEAR(emsg_assert_fails_msg); |
686 set_vim_var_string(VV_ERRMSG, NULL, 0); | 689 set_vim_var_string(VV_ERRMSG, NULL, 0); |
687 if (wrong_arg_msg != NULL) | 690 if (wrong_arg_msg != NULL) |
688 emsg(_(wrong_arg_msg)); | 691 emsg(_(wrong_arg_msg)); |
689 } | 692 } |