From 7942dab01448d21efd4e8d205eee8801e8ea637d Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Sun, 2 Aug 2020 14:47:25 +0200 Subject: [PATCH] tweaks: make a misplaced call of statusline() more obvious by crashing Also, reshuffle the lines, to take advantage of an other #ifndef. --- src/winio.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/winio.c b/src/winio.c index 82630602..0b202581 100644 --- a/src/winio.c +++ b/src/winio.c @@ -2043,6 +2043,9 @@ void statusline(message_type importance, const char *msg, ...) bool old_whitespace = ISSET(WHITESPACE_DISPLAY); UNSET(WHITESPACE_DISPLAY); + + if (isendwin()) + die("Out of curses -- please report a bug\n"); #endif /* Ignore a message with an importance that is lower than the last one. */ @@ -2050,15 +2053,6 @@ void statusline(message_type importance, const char *msg, ...) (lastmessage == MILD && importance == HUSH)) return; -#ifndef NANO_TINY - /* Curses mode shouldn't be off when trying to write to the status bar. */ - if (isendwin()) { - fprintf(stderr, "Out of curses -- please report a bug\n"); - napms(1400); - return; - } -#endif - /* If there are multiple alert messages, add trailing dots to the first. */ if (lastmessage == ALERT) { if (start_col > 4) {