vim-patch:8.2.1919: assert_fails() setting emsg_silent changes normal execution (#20998)

Problem:    Assert_fails() setting emsg_silent changes normal execution.
Solution:   Use a separate flag in_assert_fails.

28ee892ac4

Cherry-pick no_wait_return from patch 9.0.0846.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
zeertzjq
2022-11-11 17:50:52 +08:00
committed by GitHub
parent fc7ac688c3
commit 0d8e8d36ec
13 changed files with 26 additions and 18 deletions

View File

@@ -195,7 +195,6 @@ EXTERN int emsg_skip INIT(= 0); // don't display errors for
EXTERN bool emsg_severe INIT(= false); // use message of next of several
// emsg() calls for throw
// used by assert_fails()
EXTERN bool emsg_assert_fails_used INIT(= false);
EXTERN char *emsg_assert_fails_msg INIT(= NULL);
EXTERN long emsg_assert_fails_lnum INIT(= 0);
EXTERN char *emsg_assert_fails_context INIT(= NULL);
@@ -667,6 +666,8 @@ EXTERN int emsg_silent INIT(= 0); // don't print error messages
EXTERN bool emsg_noredir INIT(= false); // don't redirect error messages
EXTERN bool cmd_silent INIT(= false); // don't echo the command line
EXTERN bool in_assert_fails INIT(= false); // assert_fails() active
// Values for swap_exists_action: what to do when swap file already exists
#define SEA_NONE 0 // don't use dialog
#define SEA_DIALOG 1 // use dialog when possible