To: vim_dev@googlegroups.com Subject: Patch 9.0.0896 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 9.0.0896 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) Files: src/testdir/test_termcodes.vim *** ../vim-9.0.0895/src/testdir/test_termcodes.vim 2022-11-16 20:33:17.088528372 +0000 --- src/testdir/test_termcodes.vim 2022-11-17 16:42:49.535927507 +0000 *************** *** 2534,2548 **** 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" " --- 2534,2550 ---- 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. 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" " use for let &t_k3 = "\[7;*~" " use for let &t_@7 = "\[@;*F" " *************** *** 2550,2562 **** 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 --- 2552,2564 ---- call feedkeys("i\\OH\n\", 'tx') call feedkeys("i\\[1~\n\", 'tx') call assert_equal([ ! \ '', \ '', \ ''], getline(1, '$')) bwipe! 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 *** ../vim-9.0.0895/src/version.c 2022-11-17 15:23:48.458617558 +0000 --- src/version.c 2022-11-17 16:40:15.228146420 +0000 *************** *** 697,698 **** --- 697,700 ---- { /* Add new patch number below this line */ + /**/ + 896, /**/ -- Where do you want to crash today? /// 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 ///