# HG changeset patch # User Bram Moolenaar # Date 1668631503 -3600 # Node ID f1cb6b4dbf722bc0e3db41929ca72530ae4e3263 # Parent 5fbfdada87aafea91abc111937dea933a713d5c0 patch 9.0.0890: no test for what patch 9.0.0827 fixes Commit: https://github.com/vim/vim/commit/1573e73f1c743d6792de8ee4b6f5b99545ebd3fb Author: Bram Moolenaar Date: Wed Nov 16 20:33:21 2022 +0000 patch 9.0.0890: no test for what patch 9.0.0827 fixes Problem: No test for what patch 9.0.0827 fixes. Solution: Add a test (still doesn't fail when fix is reverted). diff --git a/src/evalvars.c b/src/evalvars.c --- a/src/evalvars.c +++ b/src/evalvars.c @@ -1343,6 +1343,11 @@ skip_var_one(char_u *arg, int include_ty 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); diff --git a/src/term.c b/src/term.c --- a/src/term.c +++ b/src/term.c @@ -4720,7 +4720,7 @@ handle_version_response(int first, int * // 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} + // 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,7 +5520,8 @@ check_termcode( // no match for "code;*X" with "code;" continue; else if (termcodes[idx].code[modslen] == '@' - && (tp[modslen] != '1' || tp[modslen + 1] != ';')) + && (tp[modslen] != '1' + || tp[modslen + 1] != ';')) // no match for "[@" with "[1;" continue; else diff --git a/src/testdir/test_termcodes.vim b/src/testdir/test_termcodes.vim --- a/src/testdir/test_termcodes.vim +++ b/src/testdir/test_termcodes.vim @@ -2531,6 +2531,37 @@ func Test_special_term_keycodes() 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: "[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 = "\[1;*~" " + let &t_kh = "\[@;*H" " + let &t_k2 = "\O*H[1;*~" " use for + let &t_k3 = "\[7;*~" " use for + let &t_@7 = "\[@;*F" " + + new + call feedkeys("i\\OH\n\", 'tx') + call feedkeys("i\\[1~\n\", 'tx') + call assert_equal([ + \ '', + \ '', + \ ''], 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 diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -696,6 +696,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 890, +/**/ 889, /**/ 888,