aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ex_cmds/cmd_map_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/ex_cmds/cmd_map_spec.lua')
-rw-r--r--test/functional/ex_cmds/cmd_map_spec.lua29
1 files changed, 22 insertions, 7 deletions
diff --git a/test/functional/ex_cmds/cmd_map_spec.lua b/test/functional/ex_cmds/cmd_map_spec.lua
index 64cf53dfa9..dbbfadabd8 100644
--- a/test/functional/ex_cmds/cmd_map_spec.lua
+++ b/test/functional/ex_cmds/cmd_map_spec.lua
@@ -93,7 +93,7 @@ describe('mappings with <Cmd>', function()
{2:E5521: <Cmd> mapping must end with <CR> before second <Cmd>} |
]])
- command('noremap <F3> <Cmd><F3>let x = 2<cr>')
+ command('noremap <F3> <Cmd>let x = 3')
feed('<F3>')
screen:expect([[
^some short lines |
@@ -103,22 +103,37 @@ describe('mappings with <Cmd>', function()
{1:~ }|
{1:~ }|
{1:~ }|
- {2:E5522: <Cmd> mapping must not include <F3> key} |
+ {2:E5520: <Cmd> mapping must end with <CR>} |
]])
+ eq(0, eval('x'))
+ end)
- command('noremap <F3> <Cmd>let x = 3')
+ it('allows special keys and modifiers', function()
+ command('noremap <F3> <Cmd>normal! <Down><CR>')
feed('<F3>')
screen:expect([[
- ^some short lines |
- of test text |
+ some short lines |
+ ^of test text |
{1:~ }|
{1:~ }|
{1:~ }|
{1:~ }|
{1:~ }|
- {2:E5520: <Cmd> mapping must end with <CR>} |
+ |
+ ]])
+
+ command('noremap <F3> <Cmd>normal! <C-Right><CR>')
+ feed('<F3>')
+ screen:expect([[
+ some short lines |
+ of ^test text |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ |
]])
- eq(0, eval('x'))
end)
it('works in various modes and sees correct `mode()` value', function()