Commit d12fdda1 authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

tweaks: replace a three-case switch with an if and an else

parent 3930a697
Showing with 2 additions and 7 deletions
+2 -7
...@@ -347,19 +347,14 @@ int parse_kbinput(WINDOW *win) ...@@ -347,19 +347,14 @@ int parse_kbinput(WINDOW *win)
while (kbinput == NULL) while (kbinput == NULL)
kbinput = get_input(win, 1); kbinput = get_input(win, 1);
switch (*kbinput) { if (*kbinput == NANO_CONTROL_3) {
case ERR:
break;
case NANO_CONTROL_3:
/* Increment the escape counter. */ /* Increment the escape counter. */
escapes++; escapes++;
/* If there are four consecutive escapes, discard three of them. */ /* If there are four consecutive escapes, discard three of them. */
if (escapes > 3) if (escapes > 3)
escapes = 1; escapes = 1;
solitary = (escapes == 1 && get_key_buffer_len() == 0); solitary = (escapes == 1 && get_key_buffer_len() == 0);
/* Wait for more input. */ } else if (*kbinput != ERR) {
break;
default:
switch (escapes) { switch (escapes) {
case 0: case 0:
/* One non-escape: normal input mode. */ /* One non-escape: normal input mode. */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment