diff 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
line wrap: on
line diff
--- a/src/testdir/test_termcodes.vim
+++ b/src/testdir/test_termcodes.vim
@@ -1222,6 +1222,23 @@ func RunTest_mapping_shift(key, func)
   endif
 endfunc
 
+func Test_modifyOtherKeys_mapped()
+  set timeoutlen=10
+  imap ' <C-W>
+  imap <C-W><C-A> c-a
+  call setline(1, '')
+
+  " single quote is turned into single byte CTRL-W
+  " CTRL-A is added with a separate modifier, and needs to be simplified before
+  " the mapping can match.
+  call feedkeys("a'" .. GetEscCodeCSI27('A', 5) .. "\<Esc>", 'Lx!')
+  call assert_equal('c-a', getline(1))
+
+  iunmap '
+  iunmap <C-W><C-A>
+  set timeoutlen&
+endfunc
+
 func RunTest_mapping_works_with_shift(func)
   new
   set timeoutlen=10