patch 8.0.1067: try/catch in timer does not prevent it from being stopped
Problem: Using try/catch in timer does not prevent it from being stopped.
Solution: Reset the exception context and use did_emsg instead of
called_emsg.
diff --git a/src/message.c b/src/message.c
index 57f33dd..af22607 100644
--- a/src/message.c
+++ b/src/message.c
@@ -609,11 +609,9 @@
called_emsg = TRUE;
- /*
- * If "emsg_severe" is TRUE: When an error exception is to be thrown,
- * prefer this message over previous messages for the same command.
- */
#ifdef FEAT_EVAL
+ /* If "emsg_severe" is TRUE: When an error exception is to be thrown,
+ * prefer this message over previous messages for the same command. */
severe = emsg_severe;
emsg_severe = FALSE;
#endif
@@ -684,6 +682,9 @@
else
flush_buffers(FALSE); /* flush internal buffers */
did_emsg = TRUE; /* flag for DoOneCmd() */
+#ifdef FEAT_EVAL
+ did_uncaught_emsg = TRUE;
+#endif
}
emsg_on_display = TRUE; /* remember there is an error message */