2016-02-11 Benno Schulenberg <bensberg@justemail.net>
* src/text.c (do_linter): Go to the next item in the list before
freeing the current one. This fixes Savannah bug #46796.
+ * src/text.c (do_formatter): Don't leave curses mode, as that would
+ hide any error messages upon reentry. And if there are any messages,
+ allow the user a little time to read them.
2016-02-10 Benno Schulenberg <bensberg@justemail.net>
* src/text.c (discard_until): Prevent a chain of editing actions from
blank_bottombars();
statusbar(_("Invoking formatter, please wait"));
- endwin();
-
/* Set up an argument list to pass to execvp(). */
if (formatargs == NULL) {
formatargs = (char **)nmalloc(arglen * sizeof(char *));
/* Wait for the formatter to finish. */
wait(&format_status);
- /* Reenter curses mode. */
- doupdate();
-
- /* Restore the terminal to its previous state. */
- terminal_init();
-
if (!WIFEXITED(format_status) || WEXITSTATUS(format_status) != 0)
finalstatus = invocation_error(openfile->syntax->formatter);
else {
allow_sigwinch(TRUE);
#endif
+ statusbar(finalstatus);
+
+ /* If there were error messages, allow the user some time to read them. */
+ if (WIFEXITED(format_status) && WEXITSTATUS(format_status) == 2)
+ sleep(4);
+
/* If the formatter printed any error messages onscreen, make
* sure that they're cleared off. */
total_refresh();
-
- statusbar(finalstatus);
}
#endif /* !DISABLE_SPELLER */
#endif /* !DISABLE_COLOR */