mirror of
git://git.sv.gnu.org/nano.git
synced 2024-11-22 21:01:24 +03:00
tweaks: replace a three-case switch with an if and an else
This commit is contained in:
parent
3930a697e8
commit
d12fdda15b
@ -347,19 +347,14 @@ int parse_kbinput(WINDOW *win)
|
||||
while (kbinput == NULL)
|
||||
kbinput = get_input(win, 1);
|
||||
|
||||
switch (*kbinput) {
|
||||
case ERR:
|
||||
break;
|
||||
case NANO_CONTROL_3:
|
||||
if (*kbinput == NANO_CONTROL_3) {
|
||||
/* Increment the escape counter. */
|
||||
escapes++;
|
||||
/* If there are four consecutive escapes, discard three of them. */
|
||||
if (escapes > 3)
|
||||
escapes = 1;
|
||||
solitary = (escapes == 1 && get_key_buffer_len() == 0);
|
||||
/* Wait for more input. */
|
||||
break;
|
||||
default:
|
||||
} else if (*kbinput != ERR) {
|
||||
switch (escapes) {
|
||||
case 0:
|
||||
/* One non-escape: normal input mode. */
|
||||
|
Loading…
Reference in New Issue
Block a user