To: vim_dev@googlegroups.com Subject: Patch 9.0.0890 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ 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 "[@" with "[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 "[@" with "[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: "[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 *** ../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 -- Bram@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 ///