speller: resizing can happen also when configured with --enable-tiny
When nano was configured with --enable-tiny --enable-speller, the block_sigwinch() function should be available, to mask SIGWINCHes during a spell check.master
parent
55699dc171
commit
3f695b8fb7
22
src/nano.c
22
src/nano.c
|
@ -1300,6 +1300,18 @@ RETSIGTYPE do_continue(int signal)
|
||||||
ungetch(KEY_FLUSH);
|
ungetch(KEY_FLUSH);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef ENABLE_SPELLER
|
||||||
|
/* Block or unblock the SIGWINCH signal, depending on the blockit parameter. */
|
||||||
|
void block_sigwinch(bool blockit)
|
||||||
|
{
|
||||||
|
sigset_t winch;
|
||||||
|
|
||||||
|
sigemptyset(&winch);
|
||||||
|
sigaddset(&winch, SIGWINCH);
|
||||||
|
sigprocmask(blockit ? SIG_BLOCK : SIG_UNBLOCK, &winch, NULL);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef NANO_TINY
|
#ifndef NANO_TINY
|
||||||
/* Handler for SIGWINCH (window size change). */
|
/* Handler for SIGWINCH (window size change). */
|
||||||
RETSIGTYPE handle_sigwinch(int signal)
|
RETSIGTYPE handle_sigwinch(int signal)
|
||||||
|
@ -1362,16 +1374,6 @@ void regenerate_screen(void)
|
||||||
total_refresh();
|
total_refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Block or unblock the SIGWINCH signal, depending on the blockit parameter. */
|
|
||||||
void block_sigwinch(bool blockit)
|
|
||||||
{
|
|
||||||
sigset_t winch;
|
|
||||||
|
|
||||||
sigemptyset(&winch);
|
|
||||||
sigaddset(&winch, SIGWINCH);
|
|
||||||
sigprocmask(blockit ? SIG_BLOCK : SIG_UNBLOCK, &winch, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Handle the global toggle specified in flag. */
|
/* Handle the global toggle specified in flag. */
|
||||||
void do_toggle(int flag)
|
void do_toggle(int flag)
|
||||||
{
|
{
|
||||||
|
|
|
@ -424,10 +424,12 @@ RETSIGTYPE handle_crash(int signal);
|
||||||
#endif
|
#endif
|
||||||
RETSIGTYPE do_suspend(int signal);
|
RETSIGTYPE do_suspend(int signal);
|
||||||
RETSIGTYPE do_continue(int signal);
|
RETSIGTYPE do_continue(int signal);
|
||||||
|
#ifdef ENABLE_SPELLER
|
||||||
|
void block_sigwinch(bool blockit);
|
||||||
|
#endif
|
||||||
#ifndef NANO_TINY
|
#ifndef NANO_TINY
|
||||||
RETSIGTYPE handle_sigwinch(int signal);
|
RETSIGTYPE handle_sigwinch(int signal);
|
||||||
void regenerate_screen(void);
|
void regenerate_screen(void);
|
||||||
void block_sigwinch(bool blockit);
|
|
||||||
void do_toggle(int flag);
|
void do_toggle(int flag);
|
||||||
void enable_signals(void);
|
void enable_signals(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -2654,15 +2654,11 @@ const char *do_alt_speller(char *tempfile_name)
|
||||||
} else if (pid_spell < 0)
|
} else if (pid_spell < 0)
|
||||||
return _("Could not fork");
|
return _("Could not fork");
|
||||||
|
|
||||||
#ifndef NANO_TINY
|
|
||||||
/* Block SIGWINCHes while waiting for the alternate spell checker's end,
|
/* Block SIGWINCHes while waiting for the alternate spell checker's end,
|
||||||
* so nano doesn't get pushed past the wait(). */
|
* so nano doesn't get pushed past the wait(). */
|
||||||
block_sigwinch(TRUE);
|
block_sigwinch(TRUE);
|
||||||
#endif
|
|
||||||
wait(&alt_spell_status);
|
wait(&alt_spell_status);
|
||||||
#ifndef NANO_TINY
|
|
||||||
block_sigwinch(FALSE);
|
block_sigwinch(FALSE);
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Reenter curses mode. */
|
/* Reenter curses mode. */
|
||||||
doupdate();
|
doupdate();
|
||||||
|
|
Loading…
Reference in New Issue