tweaks: condense some cases to a single line, for more clarity

And return directly for codes that will not be changed any more.
master
Benno Schulenberg 2020-07-22 10:43:24 +02:00
parent ad2920acd0
commit 832037e2ec
1 changed files with 9 additions and 16 deletions

View File

@ -1003,24 +1003,17 @@ int parse_kbinput(WINDOW *win)
kbinput = get_input(win, 1);
keycode = *kbinput;
free(kbinput);
escapes = 0;
switch (keycode) {
case 'A':
retval = KEY_HOME; break;
case 'B':
retval = KEY_END; break;
case 'C':
retval = CONTROL_RIGHT; break;
case 'D':
retval = CONTROL_LEFT; break;
case 'A': return KEY_HOME;
case 'B': return KEY_END;
case 'C': return CONTROL_RIGHT;
case 'D': return CONTROL_LEFT;
#ifndef NANO_TINY
case 'a':
retval = shiftaltup; break;
case 'b':
retval = shiftaltdown; break;
case 'c':
retval = shiftaltright; break;
case 'd':
retval = shiftaltleft; break;
case 'a': retval = shiftaltup; break;
case 'b': retval = shiftaltdown; break;
case 'c': retval = shiftaltright; break;
case 'd': retval = shiftaltleft; break;
#endif
}
} else {