0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.2.0035: saving and restoring called_emsg is clumsy

Problem:    Saving and restoring called_emsg is clumsy.
Solution:   Count the number of error messages.
This commit is contained in:
Bram Moolenaar
2019-12-23 22:59:18 +01:00
parent 70188f5b23
commit 53989554a4
13 changed files with 32 additions and 51 deletions

View File

@@ -581,7 +581,7 @@ ignore_error(char_u *msg)
#if !defined(HAVE_STRERROR) || defined(PROTO)
/*
* Replacement for perror() that behaves more or less like emsg() was called.
* v:errmsg will be set and called_emsg will be set.
* v:errmsg will be set and called_emsg will be incremented.
*/
void
do_perror(char *msg)
@@ -620,7 +620,7 @@ emsg_core(char_u *s)
return msg_use_printf() ? FALSE : msg((char *)s);
#endif
called_emsg = TRUE;
++called_emsg;
#ifdef FEAT_EVAL
// If "emsg_severe" is TRUE: When an error exception is to be thrown,