Commit e39938c1 authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

Not leaving curses mode in the formatter, as that would hide

error messages upon reentry.  And, if there are any messages,
allowing the user a little time to read them.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5632 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
parent d4118efe
Showing with 9 additions and 10 deletions
+9 -10
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
......
......@@ -3254,8 +3254,6 @@ void do_formatter(void)
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 *));
......@@ -3296,12 +3294,6 @@ void do_formatter(void)
/* 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 {
......@@ -3327,11 +3319,15 @@ void do_formatter(void)
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 */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment