nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit c918c6563b24ebbd47aae5fb12eb2d25735b33c5
parent 577f7fafa929c825168b05b605104b7037c898db
Author: Benno Schulenberg <bensberg@justemail.net>
Date:   Thu,  5 May 2016 21:44:45 +0200

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.

Diffstat:
Msrc/search.c | 1+
Msrc/winio.c | 5+++--
2 files changed, 4 insertions(+), 2 deletions(-)

diff --git 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 @@ -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 {