Commit c918c656 authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

input: properly restore waiting mode, or retain non-waiting mode

Cancelling a search should restore waiting mode for the keyboard,
just like at the other exit points of the search routine.

And when the input routine has read in multiple keystrokes, it
should not blindly switch back to waiting mode, but only when
that mode was on before.

This fixes the second half of https://savannah.gnu.org/bugs/?47438.
No related merge requests found
Showing with 4 additions and 2 deletions
+4 -2
......@@ -294,6 +294,7 @@ int findnextstr(
if (input && func_from_key(&input) == do_cancel) {
statusbar(_("Cancelled"));
disable_nodelay();
return -2;
}
......
......@@ -180,8 +180,9 @@ void get_key_buffer(WINDOW *win)
key_buffer[key_buffer_len - 1] = input;
}
/* Switch back to waiting mode for input. */
nodelay(win, FALSE);
/* Restore waiting mode if it was on. */
if (!nodelay_mode)
nodelay(win, FALSE);
#ifdef DEBUG
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment