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

input: simplify a bit of code, reducing a four-case switch to a single if

No related merge requests found
Showing with 4 additions and 13 deletions
+4 -13
......@@ -346,19 +346,10 @@ int parse_kbinput(WINDOW *win)
case NANO_CONTROL_3:
/* Increment the escape counter. */
escapes++;
switch (escapes) {
case 1:
/* One escape: wait for more input. */
case 2:
/* Two escapes: wait for more input. */
case 3:
/* Three escapes: wait for more input. */
break;
default:
/* More than three escapes: limit the escape counter
* to no more than two, and wait for more input. */
escapes %= 3;
}
/* If there are four consecutive escapes, discard three of them. */
if (escapes > 3)
escapes = 1;
/* Wait for more input. */
break;
default:
switch (escapes) {
......
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