fix: make nvim_cmd not suppress errors inside key mapping

Closes #18632
This commit is contained in:
Famiu Haque
2022-05-19 21:49:12 +06:00
parent 95580f31b3
commit fb8fa004d8
3 changed files with 35 additions and 17 deletions

View File

@@ -3636,5 +3636,13 @@ describe('API', function()
meths.cmd({ cmd = "update" }, {})
meths.cmd({ cmd = "buffer", count = 0 }, {})
end)
it('doesn\'t suppress errors when used in keymapping', function()
meths.exec_lua([[
vim.keymap.set("n", "[l",
function() vim.api.nvim_cmd({ cmd = "echo", args = {"foo"} }, {}) end)
]], {})
feed("[l")
neq(nil, string.find(eval("v:errmsg"), "E5108:"))
end)
end)
end)