nano

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

commit d4304ca88c5b8e3810f4e23c49dc48614922a13d
parent 02d8da3bdd8312f10a832f21a29d0cd0f96690ff
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Fri, 13 Apr 2018 20:02:28 +0200

search: use a better value to mean "nothing was typed"

When the keyboard buffer is empty, return a value that is not equivalent
to <Ctrl+Space>, so that typing a bunch of these while searching is going
on will not result in some of them getting executed afterward.

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

diff --git a/src/search.c b/src/search.c @@ -219,7 +219,7 @@ int findnextstr(const char *needle, bool whole_word_only, int modus, lastkbcheck = time(NULL); /* Consume all waiting keystrokes until a Cancel. */ - while (input) { + while (input != ERR) { if (func_from_key(&input) == do_cancel) { statusbar(_("Cancelled")); enable_waiting(); diff --git a/src/winio.c b/src/winio.c @@ -363,7 +363,7 @@ int parse_kbinput(WINDOW *win) kbinput = get_input(win, 1); if (kbinput == NULL && !waiting_mode) - return 0; + return ERR; while (kbinput == NULL) kbinput = get_input(win, 1);