tweaks: make a misplaced call of statusline() more obvious by crashing

Also, reshuffle the lines, to take advantage of an other #ifndef.
master
Benno Schulenberg 2020-08-02 14:47:25 +02:00
parent 312bcebf44
commit 7942dab014
1 changed files with 3 additions and 9 deletions

View File

@ -2043,6 +2043,9 @@ void statusline(message_type importance, const char *msg, ...)
bool old_whitespace = ISSET(WHITESPACE_DISPLAY); bool old_whitespace = ISSET(WHITESPACE_DISPLAY);
UNSET(WHITESPACE_DISPLAY); UNSET(WHITESPACE_DISPLAY);
if (isendwin())
die("Out of curses -- please report a bug\n");
#endif #endif
/* Ignore a message with an importance that is lower than the last one. */ /* 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)) (lastmessage == MILD && importance == HUSH))
return; 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 there are multiple alert messages, add trailing dots to the first. */
if (lastmessage == ALERT) { if (lastmessage == ALERT) {
if (start_col > 4) { if (start_col > 4) {