commit f21b094dad87bddcb5c04feaa77cf78ae2726a43
parent a521ac4ae7b33deb6a9a1c4cc8edbf2dd0bc352f
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Mon, 27 May 2019 17:19:21 +0200
tweaks: condense a couple of comments, and reshuffle a line
Diffstat:
2 files changed, 6 insertions(+), 12 deletions(-)
diff --git a/src/nano.c b/src/nano.c
@@ -1297,10 +1297,8 @@ void regenerate_screen(void)
if (result == -1)
return;
- /* We could check whether the COLS or LINES changed, and return
- * otherwise. However, COLS and LINES are curses global variables,
- * and in some cases curses has already updated them. But not in
- * all cases. Argh. */
+ /* We could check whether COLS or LINES changed, and return otherwise,
+ * but it seems curses does not always update these global variables. */
#ifdef REDEFINING_MACROS_OK
COLS = win.ws_col;
LINES = win.ws_row;
@@ -1421,8 +1419,7 @@ void enable_signals(void)
#endif
}
-/* Disable interpretation of the flow control characters in our terminal
- * settings. */
+/* Disable the terminal's XON/XOFF flow-control characters. */
void disable_flow_control(void)
{
#ifdef HAVE_TERMIOS_H
@@ -1434,8 +1431,7 @@ void disable_flow_control(void)
#endif
}
-/* Enable interpretation of the flow control characters in our terminal
- * settings. */
+/* Enable the terminal's XON/XOFF flow-control characters. */
void enable_flow_control(void)
{
#ifdef HAVE_TERMIOS_H
diff --git a/src/text.c b/src/text.c
@@ -2559,11 +2559,9 @@ const char *do_alt_speller(char *tempfile_name)
wait(&alt_spell_status);
block_sigwinch(FALSE);
- /* Reenter curses mode. */
- doupdate();
-
- /* Restore the terminal to its previous state. */
+ /* Set the desired terminal state again, and reenter curses mode. */
terminal_init();
+ doupdate();
if (!WIFEXITED(alt_spell_status) || WEXITSTATUS(alt_spell_status) != 0)
return invocation_error(alt_speller);