nano

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

commit a08ca026f0e0b7bc595fcf5b3280b17fbf53197d
parent 180a53cc0c59fcced2f610d4090c714d97f6f260
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Mon, 20 Jul 2020 11:05:39 +0200

input: reset the counters when a three-digit sequence is not completed

When <Esc><Esc> is followed by digit 0 or 1 or 2 but then NOT two more
digits follow, then both the escape counter and the digit counter should
start afresh when a new ESC code arrives.

This fixes https://savannah.gnu.org/bugs/?58788.

Bug existed since before version 2.0.6.

Diffstat:
Msrc/winio.c | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/winio.c b/src/winio.c @@ -895,8 +895,10 @@ int parse_kbinput(WINDOW *win) if (keycode == ESC_CODE) { /* Increment the escape counter, but trim an overabundance. */ escapes++; - if (escapes > 3) + if (escapes > 3 || digit_count > 0) { + digit_count = 0; escapes = 1; + } /* Take note when an Esc arrived by itself. */ solitary = (key_buffer_len == 0); return ERR;