test: improve mapping tests and docs (#19619)

This commit is contained in:
zeertzjq
2022-08-02 11:13:22 +08:00
committed by GitHub
parent 9c91d5c613
commit 0a049c322f
8 changed files with 50 additions and 38 deletions

View File

@@ -2792,12 +2792,12 @@ describe('vim.keymap', function()
it('can make an expr mapping', function()
exec_lua [[
vim.keymap.set('n', 'aa', function() return ':lua SomeValue = 99<cr>' end, {expr = true})
vim.keymap.set('n', 'aa', function() return '<Insert>π<C-V><M-π>foo<lt><Esc>' end, {expr = true})
]]
feed('aa')
eq(99, exec_lua[[return SomeValue]])
eq({'π<M-π>foo<'}, meths.buf_get_lines(0, 0, -1, false))
end)
it('can overwrite a mapping', function()