nano

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

commit fd10c0eadd64e3afd014ca664fd15e34a1decd1c
parent 7e53fcb581b1f25ba863b82aa799fa6724d70ef1
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Tue, 21 Jul 2020 13:56:41 +0200

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.

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

diff --git 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) {