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.
master
Benno Schulenberg 2016-05-05 21:44:45 +02:00
parent 577f7fafa9
commit c918c6563b
2 changed files with 4 additions and 2 deletions

View File

@ -294,6 +294,7 @@ int findnextstr(
if (input && func_from_key(&input) == do_cancel) { if (input && func_from_key(&input) == do_cancel) {
statusbar(_("Cancelled")); statusbar(_("Cancelled"));
disable_nodelay();
return -2; return -2;
} }

View File

@ -180,8 +180,9 @@ void get_key_buffer(WINDOW *win)
key_buffer[key_buffer_len - 1] = input; key_buffer[key_buffer_len - 1] = input;
} }
/* Switch back to waiting mode for input. */ /* Restore waiting mode if it was on. */
nodelay(win, FALSE); if (!nodelay_mode)
nodelay(win, FALSE);
#ifdef DEBUG #ifdef DEBUG
{ {