Patch 9.0.0890 (after 9.0.0827)
Problem:    No test for what patch 9.0.0827 fixes.
Solution:   Add a test (still doesn't fail when fix is reverted).
Files:      src/evalvars.c, src/term.c, src/testdir/test_termcodes.vim


*** ../vim-9.0.0889/src/evalvars.c      2022-10-13 17:47:38.123364593 +0100
--- src/evalvars.c      2022-11-16 20:05:14.035994207 +0000
***************
*** 1343,1348 ****
--- 1343,1353 ----
  
      if (*arg == '@' && arg[1] != NUL)
        return arg + 2;
+ 
+     // termcap option name may have non-alpha characters
+     if (STRNCMP(arg, "&t_", 3) == 0 && arg[3] != NUL && arg[4] != NUL)
+       return arg + 5;
+ 
      end = find_name_end(*arg == '$' || *arg == '&' ? arg + 1 : arg,
                                   NULL, NULL, FNE_INCL_BR | FNE_CHECK_START);
  
*** ../vim-9.0.0889/src/term.c  2022-11-09 23:55:46.892274515 +0000
--- src/term.c  2022-11-16 20:29:41.048515547 +0000
***************
*** 4720,4726 ****
        // else if (version == 115 && arg[0] == 0 && arg[2] == 0)
        //     term_props[TPR_UNDERLINE_RGB].tpr_status = TPR_YES;
  
!       // Kitty sends 1;400{version};{secondary-version}
        if (arg[0] == 1 && arg[1] >= 4000 && arg[1] <= 4009)
        {
            term_props[TPR_KITTY].tpr_status = TPR_YES;
--- 4720,4726 ----
        // else if (version == 115 && arg[0] == 0 && arg[2] == 0)
        //     term_props[TPR_UNDERLINE_RGB].tpr_status = TPR_YES;
  
!       // Kitty up to 9.x sends 1;400{version};{secondary-version}
        if (arg[0] == 1 && arg[1] >= 4000 && arg[1] <= 4009)
        {
            term_props[TPR_KITTY].tpr_status = TPR_YES;
***************
*** 5520,5526 ****
                            // no match for "code;*X" with "code;"
                            continue;
                        else if (termcodes[idx].code[modslen] == '@'
!                                    && (tp[modslen] != '1' || tp[modslen + 1] 
!= ';'))
                            // no match for "<Esc>[@" with "<Esc>[1;"
                            continue;
                        else
--- 5520,5527 ----
                            // no match for "code;*X" with "code;"
                            continue;
                        else if (termcodes[idx].code[modslen] == '@'
!                                        && (tp[modslen] != '1'
!                                                   || tp[modslen + 1] != ';'))
                            // no match for "<Esc>[@" with "<Esc>[1;"
                            continue;
                        else
*** ../vim-9.0.0889/src/testdir/test_termcodes.vim      2022-11-02 
13:30:37.546314580 +0000
--- src/testdir/test_termcodes.vim      2022-11-16 20:29:12.608513487 +0000
***************
*** 2531,2536 ****
--- 2531,2567 ----
    bw!
  endfunc
  
+ 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>
+ 
+   new
+   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
+ endfunc
+ 
  func Test_terminal_builtin_without_gui()
    CheckNotMSWindows
  
*** ../vim-9.0.0889/src/version.c       2022-11-16 16:08:26.987063566 +0000
--- src/version.c       2022-11-16 20:31:34.168522826 +0000
***************
*** 697,698 ****
--- 697,700 ----
  {   /* Add new patch number below this line */
+ /**/
+     890,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
87. Everyone you know asks why your phone line is always busy ...and
    you tell them to send an e-mail.

 /// 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/20221116203352.F154C1C0CD2%40moolenaar.net.

Raspunde prin e-mail lui