]> granicus.if.org Git - vim/commitdiff
patch 9.0.0940: crash when typing a letter in a terminal window v9.0.0940
authorBram Moolenaar <Bram@vim.org>
Thu, 24 Nov 2022 14:05:19 +0000 (14:05 +0000)
committerBram Moolenaar <Bram@vim.org>
Thu, 24 Nov 2022 14:05:19 +0000 (14:05 +0000)
Problem:    Crash when typing a letter in a terminal window. (Shane-XB-Qian)
Solution:   Use the "vterm" variable instead of getting the terminal pointer
            from the current buffer.  (closes #11608)

src/terminal.c
src/testdir/test_termcodes.vim
src/version.c

index d0cdd4500cce907c48320f64238cb67cdf1af500..bc363175f93b5a69e5a99fa50d6537a49d37775e 100644 (file)
@@ -1590,7 +1590,7 @@ term_convert_key(term_T *term, int c, int modmask, char *buf)
     // Ctrl-Shift-i may have the key "I" instead of "i", but for the kitty
     // keyboard protocol should use "i".  Applies to all ascii letters.
     if (ASCII_ISUPPER(c)
-           && vterm_is_kitty_keyboard(curbuf->b_term->tl_vterm)
+           && vterm_is_kitty_keyboard(vterm)
            && mod == (VTERM_MOD_CTRL | VTERM_MOD_SHIFT))
        c = TOLOWER_ASC(c);
 
index 8cab98b778e75ded3b6a63185a0daf6402c6eaee..97b06c60659bde2142fcdcc16e94f7e2b733cdfb 100644 (file)
@@ -2156,6 +2156,9 @@ func Test_modifyOtherKeys_no_mapping()
 endfunc
 
 func Test_CSIu_keys_without_modifiers()
+  " make this execute faster
+  set timeoutlen=10
+
   " Escape sent as `CSI 27 u` should act as normal escape and not undo
   call setline(1, 'a')
   call feedkeys('a' .. GetEscCodeCSIuWithoutModifier("\e"), 'Lx!')
@@ -2166,6 +2169,8 @@ func Test_CSIu_keys_without_modifiers()
   call setline(1, '')
   call feedkeys('a' .. GetEscCodeCSIuWithoutModifier("\t") .. "\<Esc>", 'Lx!')
   call assert_equal("\t", getline(1))
+
+  set timeoutlen&
 endfunc
 
 " Check that when DEC mouse codes are recognized a special key is handled.
index 86f857e4ff6d2eff9ba4bf9fa173aeb80ed8fdd4..da0b1e5a5b3894df98032584a36fda7f905a9caa 100644 (file)
@@ -695,6 +695,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    940,
 /**/
     939,
 /**/