diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2023-05-07 08:34:37 +0800 |
|---|---|---|
| committer | zeertzjq <zeertzjq@outlook.com> | 2023-05-08 01:12:09 +0800 |
| commit | 32331378134599ece34298f866889b4b311d7b79 (patch) | |
| tree | 62bee36d873793ac3c306baa804df6e31d12cb70 /test | |
| parent | 29c228dc1087676af5b72f4145ab146cff75156e (diff) | |
| download | rneovim-32331378134599ece34298f866889b4b311d7b79.tar.gz rneovim-32331378134599ece34298f866889b4b311d7b79.tar.bz2 rneovim-32331378134599ece34298f866889b4b311d7b79.zip | |
vim-patch:9.0.1516: cannot use special keys in <Cmd> mapping
Problem: Cannot use special keys in <Cmd> mapping.
Solution: Do allow for special keys in <Cmd> and <ScriptCmd> mappings.
(closes vim/vim#12326)
https://github.com/vim/vim/commit/3ab3a864814f903da8a158c01820e4fbe1013c08
Diffstat (limited to 'test')
| -rw-r--r-- | test/old/testdir/test_mapping.vim | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/test/old/testdir/test_mapping.vim b/test/old/testdir/test_mapping.vim index 0cf357694f..8c957d4665 100644 --- a/test/old/testdir/test_mapping.vim +++ b/test/old/testdir/test_mapping.vim @@ -979,10 +979,6 @@ func Test_map_cmdkey() call assert_fails('call feedkeys("\<F3>", "xt")', 'E1136:') call assert_equal(0, x) - noremap <F3> <Cmd><F3>let x = 2<CR> - call assert_fails('call feedkeys("\<F3>", "xt")', 'E1137:') - call assert_equal(0, x) - noremap <F3> <Cmd>let x = 3 call assert_fails('call feedkeys("\<F3>", "xt!")', 'E1255:') call assert_equal(0, x) @@ -1084,11 +1080,6 @@ func Test_map_cmdkey() unmap <F3> unmap! <F3> %bw! - - " command line ending in "0" is handled without errors - onoremap ix <cmd>eval 0<cr> - call feedkeys('dix.', 'xt') - ounmap ix endfunc " text object enters visual mode @@ -1475,6 +1466,24 @@ func Test_map_cmdkey_redo() call delete('Xcmdtext') delfunc SelectDash ounmap i- + + new + call setline(1, 'aaa bbb ccc ddd') + + " command can contain special keys + onoremap ix <Cmd>let g:foo ..= '…'<Bar>normal! <C-Right><CR> + let g:foo = '' + call feedkeys('0dix.', 'xt') + call assert_equal('……', g:foo) + call assert_equal('ccc ddd', getline(1)) + unlet g:foo + + " command line ending in "0" is handled without errors + onoremap ix <Cmd>eval 0<CR> + call feedkeys('dix.', 'xt') + + ounmap ix + bwipe! endfunc " Test for using <script> with a map to remap characters in rhs |