feedback: when not in curses mode, write error messages to the terminal
No errors ought to occur when not in curses mode, but when they *do* occur, increase the chances that we can figure out what happened.master
parent
5954eeaff2
commit
6b9c24f7dd
11
src/winio.c
11
src/winio.c
|
@ -2254,10 +2254,6 @@ 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);
|
||||||
|
|
||||||
/* When not in curses mode, there is no status bar to display anything on. */
|
|
||||||
if (isendwin())
|
|
||||||
return;
|
|
||||||
#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. */
|
||||||
|
@ -2270,6 +2266,13 @@ void statusline(message_type importance, const char *msg, ...)
|
||||||
vsnprintf(compound, MAXCHARLEN * COLS + 1, msg, ap);
|
vsnprintf(compound, MAXCHARLEN * COLS + 1, msg, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
|
|
||||||
|
/* When not in curses mode, write the message to standard error. */
|
||||||
|
if (isendwin()) {
|
||||||
|
fprintf(stderr, "\n%s\n", compound);
|
||||||
|
free(compound);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
#if !defined(NANO_TINY) && defined(ENABLE_MULTIBUFFER)
|
#if !defined(NANO_TINY) && defined(ENABLE_MULTIBUFFER)
|
||||||
if (!we_are_running && importance == ALERT && openfile && !openfile->fmt &&
|
if (!we_are_running && importance == ALERT && openfile && !openfile->fmt &&
|
||||||
!openfile->errormessage && openfile->next != openfile)
|
!openfile->errormessage && openfile->next != openfile)
|
||||||
|
|
Loading…
Reference in New Issue