tweaks: slightly condense a function by conflating case

master
Benno Schulenberg 2020-01-26 15:34:50 +01:00
parent b8ba27bbc0
commit 5725336149
1 changed files with 6 additions and 11 deletions

View File

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