comparison src/testdir/test_termcodes.vim @ 20727:5ffe112b1afd v8.2.0916

patch 8.2.0916: mapping with partly modifyOtherKeys code does not work Commit: https://github.com/vim/vim/commit/975a880a1389e8ce6dea8d66a7c109140b2f94ec Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jun 6 22:36:24 2020 +0200 patch 8.2.0916: mapping with partly modifyOtherKeys code does not work Problem: Mapping with partly modifyOtherKeys code does not work. Solution: If there is no mapping with a separate modifier include the modifier in the key and then try mapping again. (closes #6200)
author Bram Moolenaar <Bram@vim.org>
date Sat, 06 Jun 2020 22:45:04 +0200
parents 244eb8d8d100
children 2616c5a337e0
comparison
equal deleted inserted replaced
20726:ac788439fa5a 20727:5ffe112b1afd
1220 else 1220 else
1221 exe 'iunmap ' .. a:key 1221 exe 'iunmap ' .. a:key
1222 endif 1222 endif
1223 endfunc 1223 endfunc
1224 1224
1225 func Test_modifyOtherKeys_mapped()
1226 set timeoutlen=10
1227 imap ' <C-W>
1228 imap <C-W><C-A> c-a
1229 call setline(1, '')
1230
1231 " single quote is turned into single byte CTRL-W
1232 " CTRL-A is added with a separate modifier, and needs to be simplified before
1233 " the mapping can match.
1234 call feedkeys("a'" .. GetEscCodeCSI27('A', 5) .. "\<Esc>", 'Lx!')
1235 call assert_equal('c-a', getline(1))
1236
1237 iunmap '
1238 iunmap <C-W><C-A>
1239 set timeoutlen&
1240 endfunc
1241
1225 func RunTest_mapping_works_with_shift(func) 1242 func RunTest_mapping_works_with_shift(func)
1226 new 1243 new
1227 set timeoutlen=10 1244 set timeoutlen=10
1228 1245
1229 call RunTest_mapping_shift('@', a:func) 1246 call RunTest_mapping_shift('@', a:func)