diff --git a/src/winio.c b/src/winio.c index a0bf879ce2c77eeff684f975a696d6b9938e5585..09141b13600320b8df14c661a42067499c0c3098 100644 --- a/src/winio.c +++ b/src/winio.c @@ -2088,6 +2088,7 @@ void warn_and_shortly_pause(const char *msg) void statusline(message_type importance, const char *msg, ...) { va_list ap; + static int alerts = 0; char *compound, *message; size_t start_col; bool bracketed; @@ -2112,12 +2113,20 @@ void statusline(message_type importance, const char *msg, ...) (lastmessage == MILD && importance == HUSH)) return; - /* Delay another alert message, to allow an earlier one to be noticed. */ - if (lastmessage == ALERT) + /* If the ALERT status has been reset, reset the counter. */ + if (lastmessage == HUSH) + alerts = 0; + + /* Shortly pause after each of the first three alert messages, + * to give the user time to read them. */ + if (lastmessage == ALERT && alerts < 4) napms(1200); - if (importance == ALERT) + if (importance == ALERT) { + if (++alerts > 3) + msg = "Some warnings were suppressed"; beep(); + } lastmessage = importance;