This commit is contained in:
hrsh7th
2022-01-17 19:20:09 +09:00
parent a54064d940
commit c23d810a66
2 changed files with 4 additions and 2 deletions

View File

@@ -156,16 +156,17 @@ keymap.evacuate = setmetatable({
silent = mode ~= 'c', silent = mode ~= 'c',
nowait = map.nowait, nowait = map.nowait,
}) })
elseif mode ~= 'c' then elseif mode ~= 'c' or not map.callback then
local rhs = map.rhs local rhs = map.rhs
if not map.noremap then if not map.noremap then
rhs = keymap.recursive(map.lhs, rhs) rhs = keymap.recursive(map.lhs, rhs)
end end
keymap.set_map(bufnr, mode, fallback, rhs, { keymap.set_map(bufnr, mode, fallback, rhs, {
expr = false, expr = false,
callback = map.callback,
noremap = map.noremap, noremap = map.noremap,
script = map.script, script = map.script,
silent = mode ~= 'c', silent = mode ~= 'c' and map.silent,
nowait = map.nowait, nowait = map.nowait,
}) })
else else

View File

@@ -15,6 +15,7 @@ describe('keymap', function()
'<C-@>', '<C-@>',
'<C-\\>', '<C-\\>',
'<Tab>', '<Tab>',
'<S-Tab>',
'<Plug>(example)', '<Plug>(example)',
'<C-r>="abc"<CR>', '<C-r>="abc"<CR>',
'<Cmd>normal! ==<CR>', '<Cmd>normal! ==<CR>',