Patch 9.0.1193
Problem:    Cannot map <Esc> when using the Kitty key protocol.
Solution:   Add a non-simplified mapping for K_ESC. (closes #11811)
Files:      src/misc2.c


*** ../vim-9.0.1192/src/misc2.c 2022-11-19 19:02:33.957452667 +0000
--- src/misc2.c 2023-01-13 18:28:07.698900047 +0000
***************
*** 1292,1301 ****
  }
  
  /*
!  * Try translating a <> name at (*srcp)[] to dst[].
!  * Return the number of characters added to dst[], zero for no match.
!  * 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)!
   */
      int
  trans_special(
--- 1292,1301 ----
  }
  
  /*
!  * Try translating a <> name at "(*srcp)[]" to "dst[]".
!  * Return the number of characters added to "dst[]", zero for no match.
!  * 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)!
   */
      int
  trans_special(
***************
*** 1352,1359 ****
  }
  
  /*
!  * Try translating a <> name at (*srcp)[], return the key and modifiers.
!  * srcp is advanced to after the <> name.
   * returns 0 if there is no match.
   */
      int
--- 1352,1360 ----
  }
  
  /*
!  * Try translating a <> name at "(*srcp)[]", return the key and put modifiers
!  * in "modp".
!  * "srcp" is advanced to after the <> name.
   * returns 0 if there is no match.
   */
      int
***************
*** 1486,1492 ****
                 */
                key = simplify_key(key, &modifiers);
  
!               if (!(flags & FSK_KEYCODE))
                {
                    // don't want keycode, use single byte code
                    if (key == K_BS)
--- 1487,1493 ----
                 */
                key = simplify_key(key, &modifiers);
  
!               if ((flags & FSK_KEYCODE) == 0)
                {
                    // don't want keycode, use single byte code
                    if (key == K_BS)
***************
*** 1494,1499 ****
--- 1495,1513 ----
                    else if (key == K_DEL || key == K_KDEL)
                        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.
                if (!IS_SPECIAL(key))
*** ../vim-9.0.1192/src/version.c       2023-01-13 17:36:44.315699797 +0000
--- src/version.c       2023-01-13 18:26:34.306944671 +0000
***************
*** 697,698 ****
--- 697,700 ----
  {   /* Add new patch number below this line */
+ /**/
+     1193,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
1. You actually wore a blue ribbon to protest the Communications Decency Act.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20230113184728.9EF571C0916%40moolenaar.net.

Raspunde prin e-mail lui