mirror of
https://github.com/vim/vim.git
synced 2025-07-25 10:54:51 -04:00
patch 9.0.1193: cannot map <Esc> when using the Kitty key protocol
Problem: Cannot map <Esc> when using the Kitty key protocol. Solution: Add a non-simplified mapping for K_ESC. (closes #11811)
This commit is contained in:
parent
d40f00cb43
commit
32030a9f3b
28
src/misc2.c
28
src/misc2.c
@ -1292,10 +1292,10 @@ get_special_key_name(int c, int modifiers)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Try translating a <> name at (*srcp)[] to dst[].
|
* Try translating a <> name at "(*srcp)[]" to "dst[]".
|
||||||
* Return the number of characters added to dst[], zero for no match.
|
* Return the number of characters added to "dst[]", zero for no match.
|
||||||
* If there is a match, srcp is advanced to after the <> name.
|
* If there is a match, "srcp" is advanced to after the <> name.
|
||||||
* dst[] must be big enough to hold the result (up to six characters)!
|
* "dst[]" must be big enough to hold the result (up to six characters)!
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
trans_special(
|
trans_special(
|
||||||
@ -1352,8 +1352,9 @@ special_to_buf(int key, int modifiers, int escape_ks, char_u *dst)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Try translating a <> name at (*srcp)[], return the key and modifiers.
|
* Try translating a <> name at "(*srcp)[]", return the key and put modifiers
|
||||||
* srcp is advanced to after the <> name.
|
* in "modp".
|
||||||
|
* "srcp" is advanced to after the <> name.
|
||||||
* returns 0 if there is no match.
|
* returns 0 if there is no match.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
@ -1486,7 +1487,7 @@ find_special_key(
|
|||||||
*/
|
*/
|
||||||
key = simplify_key(key, &modifiers);
|
key = simplify_key(key, &modifiers);
|
||||||
|
|
||||||
if (!(flags & FSK_KEYCODE))
|
if ((flags & FSK_KEYCODE) == 0)
|
||||||
{
|
{
|
||||||
// don't want keycode, use single byte code
|
// don't want keycode, use single byte code
|
||||||
if (key == K_BS)
|
if (key == K_BS)
|
||||||
@ -1494,6 +1495,19 @@ find_special_key(
|
|||||||
else if (key == K_DEL || key == K_KDEL)
|
else if (key == K_DEL || key == K_KDEL)
|
||||||
key = DEL;
|
key = DEL;
|
||||||
}
|
}
|
||||||
|
else if (key == 27
|
||||||
|
&& (kitty_protocol_state == KKPS_ENABLED
|
||||||
|
|| kitty_protocol_state == KKPS_DISABLED))
|
||||||
|
{
|
||||||
|
// Using the Kitty key protocol, which uses K_ESC for an
|
||||||
|
// Esc character. For the simplified keys use the Esc
|
||||||
|
// character and set did_simplify, then in the
|
||||||
|
// non-simplified keys use K_ESC.
|
||||||
|
if ((flags & FSK_SIMPLIFY) != 0)
|
||||||
|
*did_simplify = TRUE;
|
||||||
|
else
|
||||||
|
key = K_ESC;
|
||||||
|
}
|
||||||
|
|
||||||
// Normal Key with modifier: Try to make a single byte code.
|
// Normal Key with modifier: Try to make a single byte code.
|
||||||
if (!IS_SPECIAL(key))
|
if (!IS_SPECIAL(key))
|
||||||
|
@ -695,6 +695,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1193,
|
||||||
/**/
|
/**/
|
||||||
1192,
|
1192,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user