Files
neovim/src/nvim/testdir/test_termcodes.vim
zeertzjq 264791925a vim-patch:9.0.0059: test file has wrong name
Problem:    Test file has wrong name.
Solution:   Rename the file.  Various small fixes. (closes vim/vim#10674)
bb404f5ad5
2022-07-23 14:22:08 +08:00

38 lines
1.6 KiB
VimL

" Test for terminal keycodes that doesn't have termcap entries
func Test_special_term_keycodes()
new
" Test for <xHome>, <S-xHome> and <C-xHome>
" send <K_SPECIAL> <KS_EXTRA> keycode
call feedkeys("i\<C-K>\x80\xfd\x3f\n", 'xt')
" send <K_SPECIAL> <KS_MODIFIER> bitmap <K_SPECIAL> <KS_EXTRA> keycode
call feedkeys("i\<C-K>\x80\xfc\x2\x80\xfd\x3f\n", 'xt')
call feedkeys("i\<C-K>\x80\xfc\x4\x80\xfd\x3f\n", 'xt')
" Test for <xEnd>, <S-xEnd> and <C-xEnd>
call feedkeys("i\<C-K>\x80\xfd\x3d\n", 'xt')
call feedkeys("i\<C-K>\x80\xfc\x2\x80\xfd\x3d\n", 'xt')
call feedkeys("i\<C-K>\x80\xfc\x4\x80\xfd\x3d\n", 'xt')
" Test for <zHome>, <S-zHome> and <C-zHome>
call feedkeys("i\<C-K>\x80\xfd\x40\n", 'xt')
call feedkeys("i\<C-K>\x80\xfc\x2\x80\xfd\x40\n", 'xt')
call feedkeys("i\<C-K>\x80\xfc\x4\x80\xfd\x40\n", 'xt')
" Test for <zEnd>, <S-zEnd> and <C-zEnd>
call feedkeys("i\<C-K>\x80\xfd\x3e\n", 'xt')
call feedkeys("i\<C-K>\x80\xfc\x2\x80\xfd\x3e\n", 'xt')
call feedkeys("i\<C-K>\x80\xfc\x4\x80\xfd\x3e\n", 'xt')
" Test for <xUp>, <xDown>, <xLeft> and <xRight>
call feedkeys("i\<C-K>\x80\xfd\x41\n", 'xt')
call feedkeys("i\<C-K>\x80\xfd\x42\n", 'xt')
call feedkeys("i\<C-K>\x80\xfd\x43\n", 'xt')
call feedkeys("i\<C-K>\x80\xfd\x44\n", 'xt')
call assert_equal(['<Home>', '<S-Home>', '<C-Home>',
\ '<End>', '<S-End>', '<C-End>',
\ '<Home>', '<S-Home>', '<C-Home>',
\ '<End>', '<S-End>', '<C-End>',
\ '<Up>', '<Down>', '<Left>', '<Right>', ''], getline(1, '$'))
bw!
endfunc
" vim: shiftwidth=2 sts=2 expandtab