aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/message.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-08-19 21:02:38 +0800
committerGitHub <noreply@github.com>2022-08-19 21:02:38 +0800
commit7ff283b1b754e01280d82ff63aa37601ab4e1006 (patch)
treeff0082edd8ca18ec375ebe26a0b855982dd39cb2 /src/nvim/message.c
parent2af9be3db59b2e26268dc62cb65e673e2f7d4783 (diff)
parent4edf967050b0eadba4e0e2d8c0d069f8c8e4bc65 (diff)
downloadrneovim-7ff283b1b754e01280d82ff63aa37601ab4e1006.tar.gz
rneovim-7ff283b1b754e01280d82ff63aa37601ab4e1006.tar.bz2
rneovim-7ff283b1b754e01280d82ff63aa37601ab4e1006.zip
Merge pull request #19843 from zeertzjq/vim-9.0.0227
vim-patch:8.2.3946,9.0.0227: internal error improvements
Diffstat (limited to 'src/nvim/message.c')
-rw-r--r--src/nvim/message.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/nvim/message.c b/src/nvim/message.c
index 6cc68edb82..684cf7207c 100644
--- a/src/nvim/message.c
+++ b/src/nvim/message.c
@@ -830,8 +830,15 @@ static bool semsgv(const char *fmt, va_list ap)
/// detected when fuzzing vim.
void iemsg(const char *s)
{
+ if (emsg_not_now()) {
+ return;
+ }
+
emsg(s);
#ifdef ABORT_ON_INTERNAL_ERROR
+ set_vim_var_string(VV_ERRMSG, s, -1);
+ msg_putchar('\n'); // avoid overwriting the error message
+ ui_flush();
abort();
#endif
}
@@ -841,11 +848,17 @@ void iemsg(const char *s)
/// detected when fuzzing vim.
void siemsg(const char *s, ...)
{
+ if (emsg_not_now()) {
+ return;
+ }
+
va_list ap;
va_start(ap, s);
(void)semsgv(s, ap);
va_end(ap);
#ifdef ABORT_ON_INTERNAL_ERROR
+ msg_putchar('\n'); // avoid overwriting the error message
+ ui_flush();
abort();
#endif
}