Patch 9.0.0896
Problem:    Test for home key fails when 'term' is "tmux".
Solution:   Only save termcap entries that exist.  Adjust code for xHome to
            what xterm uses. (closes #11566)
Files:      src/testdir/test_termcodes.vim


*** ../vim-9.0.0895/src/testdir/test_termcodes.vim      2022-11-16 
20:33:17.088528372 +0000
--- src/testdir/test_termcodes.vim      2022-11-17 16:42:49.535927507 +0000
***************
*** 2534,2548 ****
  func Test_home_key_works()
    " The '@' character in K_HOME must only match "1" when followed by ";",
    " otherwise this code for Home is not recognized: "<Esc>[1~"
!   " Set termcap values like "xterm" uses them.
!   let save_kh = &t_kh
!   let save_K1 = &t_K1
!   let save_k2 = &t_k2
!   let save_k3 = &t_k3
!   let save_end = &t_@7
    let &t_K1 = "\<Esc>[1;*~"      " <kHome>
    let &t_kh = "\<Esc>[@;*H"      " <Home>
!   let &t_k2 = "\<Esc>O*H[1;*~"   " use <F2> for <xHome>
    let &t_k3 = "\<Esc>[7;*~"      " use <F3> for <zHome>
    let &t_@7 = "\<Esc>[@;*F"      " <End>
  
--- 2534,2550 ----
  func Test_home_key_works()
    " The '@' character in K_HOME must only match "1" when followed by ";",
    " otherwise this code for Home is not recognized: "<Esc>[1~"
!   " Set termcap values like "xterm" uses them.  Except using F2 for xHome,
!   " because that termcap entry can't be set here.
!   let save_K1 = exists('&t_K1') ? &t_K1 : ''
!   let save_kh = exists('&t_kh') ? &t_kh : ''
!   let save_k2 = exists('&t_k2') ? &t_k2 : ''
!   let save_k3 = exists('&t_k3') ? &t_k3 : ''
!   let save_end = exists('&t_@7') ? &t_@7 : ''
! 
    let &t_K1 = "\<Esc>[1;*~"      " <kHome>
    let &t_kh = "\<Esc>[@;*H"      " <Home>
!   let &t_k2 = "\<Esc>O*H"        " use <F2> for <xHome>
    let &t_k3 = "\<Esc>[7;*~"      " use <F3> for <zHome>
    let &t_@7 = "\<Esc>[@;*F"      " <End>
  
***************
*** 2550,2562 ****
    call feedkeys("i\<C-K>\<Esc>OH\n\<Esc>", 'tx')
    call feedkeys("i\<C-K>\<Esc>[1~\n\<Esc>", 'tx')
    call assert_equal([
!         \ '<Home>',
          \ '<kHome>',
          \ ''], getline(1, '$'))
  
    bwipe!
-   let &t_kh = save_kh
    let &t_K1 = save_K1
    let &t_k2 = save_k2
    let &t_k3 = save_k3
    let &t_@7 = save_end
--- 2552,2564 ----
    call feedkeys("i\<C-K>\<Esc>OH\n\<Esc>", 'tx')
    call feedkeys("i\<C-K>\<Esc>[1~\n\<Esc>", 'tx')
    call assert_equal([
!         \ '<F2>',
          \ '<kHome>',
          \ ''], getline(1, '$'))
  
    bwipe!
    let &t_K1 = save_K1
+   let &t_kh = save_kh
    let &t_k2 = save_k2
    let &t_k3 = save_k3
    let &t_@7 = save_end
*** ../vim-9.0.0895/src/version.c       2022-11-17 15:23:48.458617558 +0000
--- src/version.c       2022-11-17 16:40:15.228146420 +0000
***************
*** 697,698 ****
--- 697,700 ----
  {   /* Add new patch number below this line */
+ /**/
+     896,
  /**/

-- 
Where do you want to crash today?

 /// 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/20221117164404.DDC231C113E%40moolenaar.net.

Raspunde prin e-mail lui