diff --git a/src/search.c b/src/search.c index a7f19a7f..24d6004e 100644 --- a/src/search.c +++ b/src/search.c @@ -294,6 +294,7 @@ int findnextstr( if (input && func_from_key(&input) == do_cancel) { statusbar(_("Cancelled")); + disable_nodelay(); return -2; } diff --git a/src/winio.c b/src/winio.c index 5260a580..549a087f 100644 --- a/src/winio.c +++ b/src/winio.c @@ -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 {