diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2022-03-03 23:18:46 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-03-03 23:18:46 +0800 |
| commit | e8d047df816a935f977f403373fb57e7d8eb18a0 (patch) | |
| tree | b4c134ad07710d70b6e63b0b7092bd37af970a76 /src/nvim/testdir | |
| parent | ff20d9b10688f9c23f122c7a826b4632e95bbbe2 (diff) | |
| parent | e8107f07486ce9dffdc020baf12836e55bf90ce5 (diff) | |
| download | rneovim-e8d047df816a935f977f403373fb57e7d8eb18a0.tar.gz rneovim-e8d047df816a935f977f403373fb57e7d8eb18a0.tar.bz2 rneovim-e8d047df816a935f977f403373fb57e7d8eb18a0.zip | |
Merge pull request #17591 from zeertzjq/vim-8.2.4498
vim-patch:8.2.4498: using <Plug> with "noremap" does not work
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/test_mapping.vim | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_mapping.vim b/src/nvim/testdir/test_mapping.vim index 1080a3c85b..98440ccdd7 100644 --- a/src/nvim/testdir/test_mapping.vim +++ b/src/nvim/testdir/test_mapping.vim @@ -646,4 +646,34 @@ func Test_abbreviate_multi_byte() bwipe! endfunc +" Test for <Plug> always being mapped, even when used with "noremap". +func Test_plug_remap() + let g:foo = 0 + nnoremap <Plug>(Increase_x) <Cmd>let g:foo += 1<CR> + nmap <F2> <Plug>(Increase_x) + nnoremap <F3> <Plug>(Increase_x) + call feedkeys("\<F2>", 'xt') + call assert_equal(1, g:foo) + call feedkeys("\<F3>", 'xt') + call assert_equal(2, g:foo) + nnoremap x <Nop> + nmap <F4> x<Plug>(Increase_x)x + nnoremap <F5> x<Plug>(Increase_x)x + call setline(1, 'Some text') + normal! gg$ + call feedkeys("\<F4>", 'xt') + call assert_equal(3, g:foo) + call assert_equal('Some text', getline(1)) + call feedkeys("\<F5>", 'xt') + call assert_equal(4, g:foo) + call assert_equal('Some te', getline(1)) + nunmap <Plug>(Increase_x) + nunmap <F2> + nunmap <F3> + nunmap <F4> + nunmap <F5> + unlet g:foo + %bw! +endfunc + " vim: shiftwidth=2 sts=2 expandtab |