nano

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

commit 91910b2364ab3515e3e8245cafee6aa5083f59d8
parent 29681e0e9fcc251fc8f2a6ac0b6eeafdb2e60078
Author: Benno Schulenberg <bensberg@justemail.net>
Date:   Tue, 28 Feb 2017 14:45:02 +0100

input: count a manually entered unicode as one character

This fixes https://savannah.gnu.org/bugs/?50403.
Reported-by: David Lawrence Ramsey <pooka109@gmail.com>

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

diff --git a/src/winio.c b/src/winio.c @@ -1486,6 +1486,8 @@ int *parse_verbatim_kbinput(WINDOW *win, size_t *count) } #endif + *count = 1; + #ifdef ENABLE_UTF8 if (using_utf8()) { /* Check whether the first code is a valid starter digit: 0 or 1. */ @@ -1518,6 +1520,8 @@ int *parse_verbatim_kbinput(WINDOW *win, size_t *count) /* Insert the multibyte sequence into the input buffer. */ unget_input(seq, uni_mb_len); + *count = uni_mb_len; + free(seq); free(uni_mb); } @@ -1528,8 +1532,6 @@ int *parse_verbatim_kbinput(WINDOW *win, size_t *count) free(kbinput); - *count = 1; - /* If this is an iTerm/Eterm/rxvt double escape, take both Escapes. */ if (key_buffer_len > 3 && *key_buffer == ESC_CODE && key_buffer[1] == ESC_CODE && key_buffer[2] == '[')