mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 11:28:22 +00:00
test: typing for helpers.meths
This commit is contained in:
@@ -181,31 +181,31 @@ describe('mapset()', function()
|
||||
before_each(clear)
|
||||
|
||||
it('can restore mapping with backslash in lhs', function()
|
||||
meths.set_keymap('n', '\\ab', 'a', {})
|
||||
meths.nvim_set_keymap('n', '\\ab', 'a', {})
|
||||
eq('\nn \\ab a', exec_capture('nmap \\ab'))
|
||||
local mapargs = funcs.maparg('\\ab', 'n', false, true)
|
||||
meths.set_keymap('n', '\\ab', 'b', {})
|
||||
meths.nvim_set_keymap('n', '\\ab', 'b', {})
|
||||
eq('\nn \\ab b', exec_capture('nmap \\ab'))
|
||||
funcs.mapset('n', false, mapargs)
|
||||
eq('\nn \\ab a', exec_capture('nmap \\ab'))
|
||||
end)
|
||||
|
||||
it('can restore mapping description from the dict returned by maparg()', function()
|
||||
meths.set_keymap('n', 'lhs', 'rhs', { desc = 'map description' })
|
||||
meths.nvim_set_keymap('n', 'lhs', 'rhs', { desc = 'map description' })
|
||||
eq('\nn lhs rhs\n map description', exec_capture('nmap lhs'))
|
||||
local mapargs = funcs.maparg('lhs', 'n', false, true)
|
||||
meths.set_keymap('n', 'lhs', 'rhs', { desc = 'MAP DESCRIPTION' })
|
||||
meths.nvim_set_keymap('n', 'lhs', 'rhs', { desc = 'MAP DESCRIPTION' })
|
||||
eq('\nn lhs rhs\n MAP DESCRIPTION', exec_capture('nmap lhs'))
|
||||
funcs.mapset('n', false, mapargs)
|
||||
eq('\nn lhs rhs\n map description', exec_capture('nmap lhs'))
|
||||
end)
|
||||
|
||||
it('can restore "replace_keycodes" from the dict returned by maparg()', function()
|
||||
meths.set_keymap('i', 'foo', [['<l' .. 't>']], { expr = true, replace_keycodes = true })
|
||||
meths.nvim_set_keymap('i', 'foo', [['<l' .. 't>']], { expr = true, replace_keycodes = true })
|
||||
feed('Afoo')
|
||||
expect('<')
|
||||
local mapargs = funcs.maparg('foo', 'i', false, true)
|
||||
meths.set_keymap('i', 'foo', [['<l' .. 't>']], { expr = true })
|
||||
meths.nvim_set_keymap('i', 'foo', [['<l' .. 't>']], { expr = true })
|
||||
feed('foo')
|
||||
expect('<<lt>')
|
||||
funcs.mapset('i', false, mapargs)
|
||||
|
Reference in New Issue
Block a user