summaryrefslogtreecommitdiffstats
path: root/mp_msg.c
diff options
context:
space:
mode:
Diffstat (limited to 'mp_msg.c')
-rw-r--r--mp_msg.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/mp_msg.c b/mp_msg.c
index ff8420833f..cff4decb75 100644
--- a/mp_msg.c
+++ b/mp_msg.c
@@ -194,6 +194,8 @@ void mp_msg_va(int mod, int lev, const char *format, va_list va)
char tmp[MSGSIZE_MAX];
FILE *stream = lev <= MSGL_WARN ? stderr : stdout;
static int header = 1;
+ // indicates if last line printed was a status line
+ static int statusline;
if (!mp_msg_test(mod, lev)) return; // do not display
vsnprintf(tmp, MSGSIZE_MAX, format, va);
@@ -231,6 +233,13 @@ void mp_msg_va(int mod, int lev, const char *format, va_list va)
}
#endif
+ /* A status line is normally intended to be overwritten by the next
+ * status line, and does not end with a '\n'. If we're printing a normal
+ * line instead after the status one print '\n' to change line. */
+ if (statusline && lev != MSGL_STATUS)
+ fprintf(stream, "\n");
+ statusline = lev == MSGL_STATUS;
+
if (header)
print_msg_module(stream, mod);
set_msg_color(stream, lev);