aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/functional/api/keymap_spec.lua17
1 files changed, 12 insertions, 5 deletions
diff --git a/test/functional/api/keymap_spec.lua b/test/functional/api/keymap_spec.lua
index 4fb2d55a76..4bee10a006 100644
--- a/test/functional/api/keymap_spec.lua
+++ b/test/functional/api/keymap_spec.lua
@@ -321,7 +321,7 @@ describe('nvim_get_keymap', function()
eq({space_table}, meths.get_keymap('n'))
end)
- it('can handle lua keymaps', function()
+ it('can handle lua mappings', function()
eq(0, exec_lua [[
GlobalCount = 0
vim.api.nvim_set_keymap ('n', 'asdf', '', {callback = function() GlobalCount = GlobalCount + 1 end })
@@ -606,6 +606,13 @@ describe('nvim_set_keymap, nvim_del_keymap', function()
eq({''}, curbufmeths.get_lines(0, -1, 0))
eq(generate_mapargs('i', 'lhs', '<NOP>', {}),
get_mapargs('i', 'lhs'))
+
+ -- a single ^V in RHS is also <Nop> (see :h map-empty-rhs)
+ meths.set_keymap('i', 'lhs', '\022', {})
+ command('normal ilhs')
+ eq({''}, curbufmeths.get_lines(0, -1, 0))
+ eq(generate_mapargs('i', 'lhs', '\022', {}),
+ get_mapargs('i', 'lhs'))
end)
it('treats an empty RHS in a mapping like a <Nop>', function()
@@ -785,7 +792,7 @@ describe('nvim_set_keymap, nvim_del_keymap', function()
end)
- it (':map command shows lua keymap correctly', function()
+ it (':map command shows lua mapping correctly', function()
exec_lua [[
vim.api.nvim_set_keymap ('n', 'asdf', '', {callback = function() print('jkl;') end })
]]
@@ -793,7 +800,7 @@ describe('nvim_set_keymap, nvim_del_keymap', function()
"^\nn asdf <Lua function %d+>"))
end)
- it ('mapcheck() returns lua keymap correctly', function()
+ it ('mapcheck() returns lua mapping correctly', function()
exec_lua [[
vim.api.nvim_set_keymap ('n', 'asdf', '', {callback = function() print('jkl;') end })
]]
@@ -801,7 +808,7 @@ describe('nvim_set_keymap, nvim_del_keymap', function()
"^<Lua function %d+>"))
end)
- it ('maparg() returns lua keymap correctly', function()
+ it ('maparg() returns lua mapping correctly', function()
exec_lua [[
vim.api.nvim_set_keymap ('n', 'asdf', '', {callback = function() print('jkl;') end })
]]
@@ -895,7 +902,7 @@ describe('nvim_set_keymap, nvim_del_keymap', function()
eq('\nNo mapping found', helpers.exec_capture('nmap <C-I>'))
end)
- it('can set descriptions on keymaps', function()
+ it('can set descriptions on mappings', function()
meths.set_keymap('n', 'lhs', 'rhs', {desc="map description"})
eq(generate_mapargs('n', 'lhs', 'rhs', {desc="map description"}), get_mapargs('n', 'lhs'))
eq("\nn lhs rhs\n map description",