1
0
forked from aniani/vim

patch 9.0.0974: even when Esc is encoded a timeout is used

Problem:    Even when Esc is encoded a timeout is used.
Solution:   Use K_ESC when an encoded Esc is found.
This commit is contained in:
Bram Moolenaar
2022-11-29 20:33:20 +00:00
parent 064fd67e6a
commit dffa6ea85c
4 changed files with 33 additions and 2 deletions

View File

@@ -5121,7 +5121,19 @@ handle_key_without_modifier(
int *buflen)
{
char_u string[MAX_KEY_CODE_LEN + 1];
int new_slen = add_key_to_buf(arg[0], string);
int new_slen;
if (arg[0] == ESC)
{
// Putting Esc in the buffer creates ambiguity, it can be the start of
// an escape sequence. Use K_ESC to avoid that.
string[0] = K_SPECIAL;
string[1] = KS_EXTRA;
string[2] = KE_ESC;
new_slen = 3;
}
else
new_slen = add_key_to_buf(arg[0], string);
if (put_string_in_typebuf(offset, csi_len, string, new_slen,
buf, bufsize, buflen) == FAIL)