From: Bram Moolenaar Date: Thu, 17 Nov 2022 16:43:35 +0000 (+0000) Subject: patch 9.0.0896: test for home key fails when 'term' is "tmux" X-Git-Tag: v9.0.0896 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1d8765daba6f4b3b7fcf51a77e9d1ba0090c826e;p=vim patch 9.0.0896: test for home key fails when 'term' is "tmux" 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) --- diff --git a/src/testdir/test_termcodes.vim b/src/testdir/test_termcodes.vim index 6d1d39682..a122e5bdf 100644 --- a/src/testdir/test_termcodes.vim +++ b/src/testdir/test_termcodes.vim @@ -2534,15 +2534,17 @@ 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 + " 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 = "\[1;*~" " let &t_kh = "\[@;*H" " - let &t_k2 = "\O*H[1;*~" " use for + let &t_k2 = "\O*H" " use for let &t_k3 = "\[7;*~" " use for let &t_@7 = "\[@;*F" " @@ -2550,13 +2552,13 @@ func Test_home_key_works() 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_kh = save_kh let &t_k2 = save_k2 let &t_k3 = save_k3 let &t_@7 = save_end diff --git a/src/version.c b/src/version.c index fdccde945..e3af09547 100644 --- a/src/version.c +++ b/src/version.c @@ -695,6 +695,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 896, /**/ 895, /**/