avoid unnecessary state saving for when we resize

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3496 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
David Lawrence Ramsey 2006-05-10 15:15:06 +00:00
parent fc0f8f8c57
commit 1c5af644b5
4 changed files with 22 additions and 7 deletions

View File

@ -25,9 +25,12 @@
/* Global variables. */
#ifndef NANO_TINY
sigjmp_buf jmpbuf;
sigjmp_buf jump_buf;
/* Used to return to main() or the unjustify routine in
* do_justify() after a SIGWINCH. */
bool jump_buf_main = FALSE;
/* Have we set jump_buf so that we return to main() after a
* SIGWINCH? */
#endif
#ifndef DISABLE_WRAPJUSTIFY

View File

@ -1081,8 +1081,9 @@ RETSIGTYPE handle_sigwinch(int signal)
currshortcut = main_list;
total_refresh();
/* Jump back to the main loop. */
siglongjmp(jmpbuf, 1);
/* Jump back to either main() or the unjustify routine in
* do_justify(). */
siglongjmp(jump_buf, 1);
}
/* If allow is TRUE, block any SIGWINCH signals that we get, so that we
@ -2134,8 +2135,14 @@ int main(int argc, char **argv)
reset_cursor();
#ifndef NANO_TINY
/* Return here after a SIGWINCH. */
sigsetjmp(jmpbuf, 1);
if (!jump_buf_main) {
/* If we haven't already, we're going to set jump_buf so
* that we return here after a SIGWINCH. Indicate this. */
jump_buf_main = TRUE;
/* Return here after a SIGWINCH. */
sigsetjmp(jump_buf, 1);
}
#endif
/* If constant cursor position display is on, and there are no

View File

@ -28,7 +28,8 @@
/* Public externs. See global.c for descriptions of them. */
#ifndef NANO_TINY
extern sigjmp_buf jmpbuf;
extern sigjmp_buf jump_buf;
extern bool jump_buf_main;
#endif
#ifndef DISABLE_WRAPJUSTIFY

View File

@ -1656,8 +1656,12 @@ void do_justify(bool full_justify)
edit_refresh();
#ifndef NANO_TINY
/* We're going to set jump_buf so that we return here after a
* SIGWINCH instead of to main(). Indicate this. */
jump_buf_main = FALSE;
/* Return here after a SIGWINCH. */
sigsetjmp(jmpbuf, 1);
sigsetjmp(jump_buf, 1);
#endif
statusbar(_("Can now UnJustify!"));