nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit d12fdda15bdbaa6ae0d1502888d453393ed471af
parent 3930a697e85923459c7782022bfd11125b9dbbcc
Author: Benno Schulenberg <bensberg@justemail.net>
Date:   Sat,  7 May 2016 21:33:22 +0200

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

Diffstat:
Msrc/winio.c | 9++-------
1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/src/winio.c b/src/winio.c @@ -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. */