mirror of
git://git.sv.gnu.org/nano.git
synced 2024-11-25 22:29:42 +03:00
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.
This commit is contained in:
parent
180a53cc0c
commit
a08ca026f0
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user