comparison src/testdir/test_mapping.vim @ 20627:8bce783af0cb v8.2.0867

patch 8.2.0867: using {xxx} for encoding a modifier is not nice Commit: https://github.com/vim/vim/commit/fccd93f0917234b962ce07d1df3adf9d7105936f Author: Bram Moolenaar <Bram@vim.org> Date: Sun May 31 22:06:51 2020 +0200 patch 8.2.0867: using \{xxx} for encoding a modifier is not nice Problem: Using \{xxx} for encoding a modifier is not nice. Solution: Use \<*xxx> instead, since it's the same as \<xxx> but producing a different code.
author Bram Moolenaar <Bram@vim.org>
date Sun, 31 May 2020 22:15:03 +0200
parents c2570baa2e4c
children 08940efa6b4e
comparison
equal deleted inserted replaced
20626:38f728a93c07 20627:8bce783af0cb
74 " mapping of ctrl-c in Insert mode 74 " mapping of ctrl-c in Insert mode
75 set cpo-=< cpo-=k 75 set cpo-=< cpo-=k
76 inoremap <c-c> <ctrl-c> 76 inoremap <c-c> <ctrl-c>
77 cnoremap <c-c> dummy 77 cnoremap <c-c> dummy
78 cunmap <c-c> 78 cunmap <c-c>
79 call feedkeys("GoTEST2: CTRL-C |\{C-C}A|\<Esc>", "xt") 79 call feedkeys("GoTEST2: CTRL-C |\<*C-C>A|\<Esc>", "xt")
80 call assert_equal('TEST2: CTRL-C |<ctrl-c>A|', getline('$')) 80 call assert_equal('TEST2: CTRL-C |<ctrl-c>A|', getline('$'))
81 unmap! <c-c> 81 unmap! <c-c>
82 set nomodified 82 set nomodified
83 endfunc 83 endfunc
84 84
85 func Test_map_ctrl_c_visual() 85 func Test_map_ctrl_c_visual()
86 " mapping of ctrl-c in Visual mode 86 " mapping of ctrl-c in Visual mode
87 vnoremap <c-c> :<C-u>$put ='vmap works' 87 vnoremap <c-c> :<C-u>$put ='vmap works'
88 call feedkeys("GV\{C-C}\<CR>", "xt") 88 call feedkeys("GV\<*C-C>\<CR>", "xt")
89 call assert_equal('vmap works', getline('$')) 89 call assert_equal('vmap works', getline('$'))
90 vunmap <c-c> 90 vunmap <c-c>
91 set nomodified 91 set nomodified
92 endfunc 92 endfunc
93 93
233 set nomodified 233 set nomodified
234 endfunc 234 endfunc
235 235
236 func Test_map_meta_quotes() 236 func Test_map_meta_quotes()
237 imap <M-"> foo 237 imap <M-"> foo
238 call feedkeys("Go-\{M-\"}-\<Esc>", "xt") 238 call feedkeys("Go-\<*M-\">-\<Esc>", "xt")
239 call assert_equal("-foo-", getline('$')) 239 call assert_equal("-foo-", getline('$'))
240 set nomodified 240 set nomodified
241 iunmap <M-"> 241 iunmap <M-">
242 endfunc 242 endfunc
243 243