From fd10c0eadd64e3afd014ca664fd15e34a1decd1c Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Tue, 21 Jul 2020 13:56:41 +0200 Subject: [PATCH] tweaks: rake a common statement to the end of the case With the two situations that need to preserve the escape counter now returning directly, the resetting of this counter can happen at the end of each case block. --- src/winio.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/winio.c b/src/winio.c index a0070b23..41ea66ff 100644 --- a/src/winio.c +++ b/src/winio.c @@ -979,7 +979,6 @@ int parse_kbinput(WINDOW *win) #endif } double_esc = FALSE; - escapes = 0; } else if (key_buffer_len == 0) { if ('0' <= keycode && (keycode <= '2' || (keycode <= '9' && digit_count > 0))) { @@ -1003,13 +1002,10 @@ int parse_kbinput(WINDOW *win) put_back((unsigned char)(byte - 0x40)); put_back(0xC3); } - escapes = 0; } #endif - else { + else retval = byte; - escapes = 0; - } } else { if (digit_count > 0) /* A non-digit in the middle of a byte sequence: @@ -1024,7 +1020,6 @@ int parse_kbinput(WINDOW *win) } else retval = convert_to_control(keycode); } - escapes = 0; } } else if (keycode == '[' && (('A' <= *key_buffer && *key_buffer <= 'D') || ('a' <= *key_buffer && *key_buffer <= 'd'))) { @@ -1036,8 +1031,8 @@ int parse_kbinput(WINDOW *win) * codes waiting: combined meta and escape sequence mode. */ retval = parse_escape_sequence(keycode); meta_key = TRUE; - escapes = 0; } + escapes = 0; break; case 3: if (key_buffer_len == 0) {