nano

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

commit 50b61bef6f41778b0e42796e618820ac228a219a
parent 3d0bfb0a003b8f6816be05bb899db08f3a9b8423
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Sat, 15 Aug 2020 13:44:25 +0200

input: discard any multibyte character when <Alt> is being held

Otherwise the <Alt> key would simply be ignored.  It's better to reject
the combination, to compel the user to be precise in what they type.

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

diff --git a/src/winio.c b/src/winio.c @@ -939,6 +939,13 @@ int parse_kbinput(WINDOW *win) keycode == DEL_CODE) return CONTROL_SHIFT_DELETE; #endif +#ifdef ENABLE_UTF8 + else if (0xC0 <= keycode && keycode <= 0xFF && using_utf8()) { + while (key_buffer_len > 0 && 0x80 <= *key_buffer && *key_buffer <= 0xBF) + get_input(NULL); + return FOREIGN_SEQUENCE; + } +#endif else if (!solitary && keycode < 0x20) meta_key = TRUE; } else if (key_buffer_len == 0 || *key_buffer == ESC_CODE ||