input: don't drop a keystroke on the floor when the terminal resizes

This fixes the first part of https://savannah.gnu.org/bugs/?48331.

Reported-by: Mike Frysinger <vapier@gentoo.org>
master
Benno Schulenberg 2016-06-29 15:53:08 +02:00
parent 2ae490cd8f
commit 1d7c177606
1 changed files with 3 additions and 1 deletions

View File

@ -141,8 +141,10 @@ void get_key_buffer(WINDOW *win)
input = wgetch(win);
#ifndef NANO_TINY
if (the_window_resized())
if (the_window_resized()) {
ungetch(input);
input = KEY_WINCH;
}
#endif
if (input == ERR && nodelay_mode)