comparison src/testdir/test_termcodes.vim @ 18295:43e9523f6d84 v8.1.2142

patch 8.1.2142: some key mappings do not work with modifyOtherKeys Commit: https://github.com/vim/vim/commit/d1e2f3984ae0b4e22ba6977eedcf05285819eea9 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Oct 12 18:22:50 2019 +0200 patch 8.1.2142: some key mappings do not work with modifyOtherKeys Problem: Some key mappings do not work with modifyOtherKeys. Solution: Remove the Shift modifier if it is already included in the key.
author Bram Moolenaar <Bram@vim.org>
date Sat, 12 Oct 2019 18:30:04 +0200
parents 16dd8ebc2339
children 506bf60a30a0
comparison
equal deleted inserted replaced
18294:98c9b8a53e77 18295:43e9523f6d84
907 endfunc 907 endfunc
908 908
909 func Test_modifyOtherKeys_CSIu() 909 func Test_modifyOtherKeys_CSIu()
910 call RunTest_modifyOtherKeys(function('GetEscCodeCSIu')) 910 call RunTest_modifyOtherKeys(function('GetEscCodeCSIu'))
911 endfunc 911 endfunc
912
913 func RunTest_mapping_shift(key, func)
914 call setline(1, '')
915 if a:key == '|'
916 exe 'inoremap \| xyz'
917 else
918 exe 'inoremap ' .. a:key .. ' xyz'
919 endif
920 call feedkeys('a' .. a:func(a:key, 2) .. "\<Esc>", 'Lx!')
921 call assert_equal("xyz", getline(1))
922 if a:key == '|'
923 exe 'iunmap \|'
924 else
925 exe 'iunmap ' .. a:key
926 endif
927 endfunc
928
929 func RunTest_mapping_works_with_shift(func)
930 new
931 set timeoutlen=20
932
933 call RunTest_mapping_shift('@', a:func)
934 call RunTest_mapping_shift('A', a:func)
935 call RunTest_mapping_shift('Z', a:func)
936 call RunTest_mapping_shift('^', a:func)
937 call RunTest_mapping_shift('_', a:func)
938 call RunTest_mapping_shift('{', a:func)
939 call RunTest_mapping_shift('|', a:func)
940 call RunTest_mapping_shift('}', a:func)
941 call RunTest_mapping_shift('~', a:func)
942
943 bwipe!
944 set timeoutlen&
945 endfunc
946
947 func Test_mapping_works_with_shift()
948 call RunTest_mapping_works_with_shift(function('GetEscCodeCSI27'))
949 call RunTest_mapping_works_with_shift(function('GetEscCodeCSIu'))
950 endfunc