patch 8.2.2097: Vim9: using :silent! when calling a function prevents abort
Problem: Vim9: using :silent! when calling a function prevents abortng that
function.
Solution: Add emsg_silent_def and did_emsg_def.
diff --git a/src/globals.h b/src/globals.h
index af1a85c..4f54d0f 100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -230,6 +230,8 @@
EXTERN int did_emsg; // set by emsg() when the message
// is displayed or thrown
#ifdef FEAT_EVAL
+EXTERN int did_emsg_def; // set by emsg() when emsg_silent
+ // is set before calling a function
EXTERN int did_emsg_cumul; // cumulative did_emsg, increased
// when did_emsg is reset.
EXTERN int called_vim_beep; // set if vim_beep() is called
@@ -1134,6 +1136,10 @@
EXTERN int msg_silent INIT(= 0); // don't print messages
EXTERN int emsg_silent INIT(= 0); // don't print error messages
+#ifdef FEAT_EVAL
+EXTERN int emsg_silent_def INIT(= 0); // value of emsg_silent when a :def
+ // function is called
+#endif
EXTERN int emsg_noredir INIT(= 0); // don't redirect error messages
EXTERN int cmd_silent INIT(= FALSE); // don't echo the command line