Mercurial > vim
diff 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 |
line wrap: on
line diff
--- a/src/testing.c +++ b/src/testing.c @@ -555,8 +555,7 @@ f_assert_fails(typval_T *argvars, typval // trylevel must be zero for a ":throw" command to be considered failed trylevel = 0; suppress_errthrow = TRUE; - emsg_silent = TRUE; - emsg_assert_fails_used = TRUE; + in_assert_fails = TRUE; do_cmdline_cmd(cmd); if (called_emsg == called_emsg_before) @@ -679,9 +678,13 @@ f_assert_fails(typval_T *argvars, typval theend: trylevel = save_trylevel; suppress_errthrow = FALSE; - emsg_silent = FALSE; + in_assert_fails = FALSE; + did_emsg = FALSE; + msg_col = 0; + need_wait_return = FALSE; emsg_on_display = FALSE; - emsg_assert_fails_used = FALSE; + msg_scrolled = 0; + lines_left = Rows; VIM_CLEAR(emsg_assert_fails_msg); set_vim_var_string(VV_ERRMSG, NULL, 0); if (wrong_arg_msg != NULL)