nano

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

commit 57253361496d8d661239285df0882888eb67dd0d
parent b8ba27bbc099c2a1922ef1a22666e1f23da0cc2d
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Sun, 26 Jan 2020 15:34:50 +0100

tweaks: slightly condense a function by conflating case

Diffstat:
Msrc/global.c | 17++++++-----------
1 file changed, 6 insertions(+), 11 deletions(-)

diff --git a/src/global.c b/src/global.c @@ -489,32 +489,27 @@ functionptrtype func_from_key(int *kbinput) functionptrtype interpret(int *keycode) { if (!meta_key) { - switch (*keycode) { + if (*keycode == 'N') + return do_findprevious; + if (*keycode == 'n') + return do_findnext; + + switch (tolower(*keycode)) { case '-': return do_page_up; case ' ': return do_page_down; - case 'W': case 'w': case '/': return do_search_forward; - case 'N': - return do_findprevious; - case 'n': - return do_findnext; - case 'G': case 'g': return goto_dir_void; case '?': return do_help; - case 'S': case 's': return do_enter; - case 'E': case 'e': - case 'Q': case 'q': - case 'X': case 'x': return do_exit; }