From: David Lawrence Ramsey Date: Tue, 26 Jul 2005 01:17:16 +0000 (+0000) Subject: and don't let a SIGWINCH throw out the changes made by the alternate X-Git-Tag: v1.3.9~108 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=3fe08acd273af2c11eb44b5a1aef22e28214912d;p=nano.git and don't let a SIGWINCH throw out the changes made by the alternate spell checker, either git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2938 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- diff --git a/ChangeLog b/ChangeLog index e239c0e8..3134d69b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -174,7 +174,9 @@ CVS code - what the internal spell checker returns under the same circumstances. (DLR) - Block any pending SIGWINCHes while the alternate spell checker - is running, so that it can handle them. (DLR) + is running, so that it can handle them, and unblock them once + it's finished and we've loaded the spell-checked file back in. + (DLR) do_spell() - When displaying an error message from do_(int|alt)_speller(), don't display the error message corresponding to errno if diff --git a/src/text.c b/src/text.c index c74de28b..603a1404 100644 --- a/src/text.c +++ b/src/text.c @@ -1887,18 +1887,13 @@ const char *do_alt_speller(char *tempfile_name) #ifndef NANO_SMALL /* Don't handle a pending SIGWINCH until the alternate spell checker - * is finished. */ + * is finished and we've loaded the spell-checked file back in. */ allow_pending_sigwinch(FALSE); #endif /* Wait for the alternate spell checker to finish. */ wait(&alt_spell_status); -#ifndef NANO_SMALL - /* Handle a pending SIGWINCH again. */ - allow_pending_sigwinch(TRUE); -#endif - refresh(); /* Restore the terminal to its previous state. */ @@ -1907,6 +1902,10 @@ const char *do_alt_speller(char *tempfile_name) /* Turn the cursor back on for sure. */ curs_set(1); + /* The screen might have been resized. If it has, reinitialize all + * the windows based on the new screen dimensions. */ + window_init(); + if (!WIFEXITED(alt_spell_status) || WEXITSTATUS(alt_spell_status) != 0) { char *altspell_error; @@ -2005,6 +2004,11 @@ const char *do_alt_speller(char *tempfile_name) do_gotopos(lineno_save, current_x_save, current_y_save, pww_save); set_modified(); +#ifndef NANO_SMALL + /* Handle a pending SIGWINCH again. */ + allow_pending_sigwinch(TRUE); +#endif + return NULL; }