display: restore the ability to resize the screen while searching

This ability was lost in commit 92298349 from two hours ago, which
bypasses the keystroke buffer and its integrated screen resizing.

This new implementation is better than it was before, because it
responds almost instantly to a resize instead of with a delay of
up to a second.
master
Benno Schulenberg 2020-08-20 10:07:14 +02:00
parent 8daa7cbda0
commit aa257ef58e
1 changed files with 12 additions and 0 deletions

View File

@ -208,6 +208,10 @@ int findnextstr(const char *needle, bool whole_word_only, int modus,
meta_key = FALSE;
if (func_from_key(&input) == do_cancel) {
#ifndef NANO_TINY
if (the_window_resized)
regenerate_screen();
#endif
statusbar(_("Cancelled"));
/* Clear out the key buffer (in case a macro is running). */
while (input != ERR)
@ -256,6 +260,14 @@ int findnextstr(const char *needle, bool whole_word_only, int modus,
break;
}
#ifndef NANO_TINY
if (the_window_resized) {
regenerate_screen();
nodelay(edit, TRUE);
statusbar(_("Searching..."));
feedback = 1;
}
#endif
/* If we're back at the beginning, then there is no needle. */
if (came_full_circle) {
nodelay(edit, FALSE);