From aa257ef58e5d53fd7cba48eceec064f39ac9f2e2 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Thu, 20 Aug 2020 10:07:14 +0200 Subject: [PATCH] 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. --- src/search.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/search.c b/src/search.c index a8555412..f1c3c354 100644 --- a/src/search.c +++ b/src/search.c @@ -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);