From 28ee892ac4197421b3317f195512ca64cc56a5b4 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 28 Oct 2020 20:20:00 +0100 Subject: 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. --- src/testing.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/testing.c') diff --git a/src/testing.c b/src/testing.c index 811544103..919b91182 100644 --- a/src/testing.c +++ b/src/testing.c @@ -555,8 +555,7 @@ f_assert_fails(typval_T *argvars, typval_T *rettv) // 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_T *rettv) 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) -- cgit v1.2.1