0
0
mirror of https://github.com/vim/vim.git synced 2025-09-29 04:34:16 -04:00

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).
This commit is contained in:
Bram Moolenaar
2022-11-16 20:33:21 +00:00
parent 8303035d67
commit 1573e73f1c
4 changed files with 41 additions and 2 deletions

View File

@@ -1343,6 +1343,11 @@ skip_var_one(char_u *arg, int include_type)
if (*arg == '@' && arg[1] != NUL) if (*arg == '@' && arg[1] != NUL)
return arg + 2; 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, end = find_name_end(*arg == '$' || *arg == '&' ? arg + 1 : arg,
NULL, NULL, FNE_INCL_BR | FNE_CHECK_START); NULL, NULL, FNE_INCL_BR | FNE_CHECK_START);

View File

@@ -4720,7 +4720,7 @@ handle_version_response(int first, int *arg, int argc, char_u *tp)
// else if (version == 115 && arg[0] == 0 && arg[2] == 0) // else if (version == 115 && arg[0] == 0 && arg[2] == 0)
// term_props[TPR_UNDERLINE_RGB].tpr_status = TPR_YES; // 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) if (arg[0] == 1 && arg[1] >= 4000 && arg[1] <= 4009)
{ {
term_props[TPR_KITTY].tpr_status = TPR_YES; term_props[TPR_KITTY].tpr_status = TPR_YES;
@@ -5520,7 +5520,8 @@ check_termcode(
// no match for "code;*X" with "code;" // no match for "code;*X" with "code;"
continue; continue;
else if (termcodes[idx].code[modslen] == '@' else if (termcodes[idx].code[modslen] == '@'
&& (tp[modslen] != '1' || tp[modslen + 1] != ';')) && (tp[modslen] != '1'
|| tp[modslen + 1] != ';'))
// no match for "<Esc>[@" with "<Esc>[1;" // no match for "<Esc>[@" with "<Esc>[1;"
continue; continue;
else else

View File

@@ -2531,6 +2531,37 @@ func Test_special_term_keycodes()
bw! bw!
endfunc 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() func Test_terminal_builtin_without_gui()
CheckNotMSWindows CheckNotMSWindows

View File

@@ -695,6 +695,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
890,
/**/ /**/
889, 889,
/**/ /**/