Patch 9.0.1199
Problem: Crash when using kitty and using a mapping with <Esc>.
Solution: Do not try setting did_simplify when it is NULL. (closes #11817)
Files: src/misc2.c, src/term.c, src/vim.h
*** ../vim-9.0.1198/src/misc2.c 2023-01-14 12:32:24.219984103 +0000
--- src/misc2.c 2023-01-14 21:02:43.290773709 +0000
***************
*** 1498,1503 ****
--- 1498,1504 ----
key = DEL;
}
else if (key == 27
+ && (flags & FSK_FROM_PART) != 0
&& (kitty_protocol_state == KKPS_ENABLED
|| kitty_protocol_state == KKPS_DISABLED))
{
***************
*** 1506,1512 ****
// 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;
}
--- 1507,1516 ----
// character and set did_simplify, then in the
// non-simplified keys use K_ESC.
if ((flags & FSK_SIMPLIFY) != 0)
! {
! if (did_simplify != NULL)
! *did_simplify = TRUE;
! }
else
key = K_ESC;
}
*** ../vim-9.0.1198/src/term.c 2023-01-10 19:17:08.078354902 +0000
--- src/term.c 2023-01-14 21:03:22.958800875 +0000
***************
*** 6636,6643 ****
}
}
#endif
! slen = trans_special(&src, result + dlen, FSK_KEYCODE
! | ((flags & REPTERM_NO_SIMPLIFY) ? 0 : FSK_SIMPLIFY),
TRUE, did_simplify);
if (slen > 0)
{
--- 6639,6648 ----
}
}
#endif
! int fsk_flags = FSK_KEYCODE
! | ((flags & REPTERM_NO_SIMPLIFY) ? 0 : FSK_SIMPLIFY)
! | ((flags & REPTERM_FROM_PART) ? FSK_FROM_PART : 0);
! slen = trans_special(&src, result + dlen, fsk_flags,
TRUE, did_simplify);
if (slen > 0)
{
*** ../vim-9.0.1198/src/vim.h 2023-01-12 21:07:58.640905098 +0000
--- src/vim.h 2023-01-14 21:01:50.058737276 +0000
***************
*** 2818,2823 ****
--- 2818,2824 ----
#define FSK_KEEP_X_KEY 0x02 // don't translate xHome to Home key
#define FSK_IN_STRING 0x04 // TRUE in string, double quote is escaped
#define FSK_SIMPLIFY 0x08 // simplify <C-H> and <A-x>
+ #define FSK_FROM_PART 0x10 // left-hand-side of mapping
// Flags for the readdirex function, how to sort the result
#define READDIR_SORT_NONE 0 // do not sort
*** ../vim-9.0.1198/src/version.c 2023-01-14 13:12:01.858485739 +0000
--- src/version.c 2023-01-14 20:57:10.054545894 +0000
***************
*** 697,698 ****
--- 697,700 ----
{ /* Add new patch number below this line */
+ /**/
+ 1199,
/**/
--
hundred-and-one symptoms of being an internet addict:
11. You find yourself typing "com" after every period when using a word
processor.com
/// Bram Moolenaar -- Br...@Moolenaar.net --
http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features --
http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims --
http://ICCF-Holland.org ///