tweaks: condense some cases to a single line, for more clarity
And return directly for codes that will not be changed any more.master
parent
ad2920acd0
commit
832037e2ec
25
src/winio.c
25
src/winio.c
|
@ -1003,24 +1003,17 @@ int parse_kbinput(WINDOW *win)
|
||||||
kbinput = get_input(win, 1);
|
kbinput = get_input(win, 1);
|
||||||
keycode = *kbinput;
|
keycode = *kbinput;
|
||||||
free(kbinput);
|
free(kbinput);
|
||||||
|
escapes = 0;
|
||||||
switch (keycode) {
|
switch (keycode) {
|
||||||
case 'A':
|
case 'A': return KEY_HOME;
|
||||||
retval = KEY_HOME; break;
|
case 'B': return KEY_END;
|
||||||
case 'B':
|
case 'C': return CONTROL_RIGHT;
|
||||||
retval = KEY_END; break;
|
case 'D': return CONTROL_LEFT;
|
||||||
case 'C':
|
|
||||||
retval = CONTROL_RIGHT; break;
|
|
||||||
case 'D':
|
|
||||||
retval = CONTROL_LEFT; break;
|
|
||||||
#ifndef NANO_TINY
|
#ifndef NANO_TINY
|
||||||
case 'a':
|
case 'a': retval = shiftaltup; break;
|
||||||
retval = shiftaltup; break;
|
case 'b': retval = shiftaltdown; break;
|
||||||
case 'b':
|
case 'c': retval = shiftaltright; break;
|
||||||
retval = shiftaltdown; break;
|
case 'd': retval = shiftaltleft; break;
|
||||||
case 'c':
|
|
||||||
retval = shiftaltright; break;
|
|
||||||
case 'd':
|
|
||||||
retval = shiftaltleft; break;
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue