fix(cmd): shedule error message instead of showing directly

This commit is contained in:
Folke Lemaitre 2023-10-17 16:52:32 +02:00
parent 7613ab2abb
commit 03419f3e5f
No known key found for this signature in database
GPG Key ID: 41F8B1FBACAE2040
1 changed files with 4 additions and 1 deletions

View File

@ -35,7 +35,10 @@ function M:_add(cmd)
local info = vim.api.nvim_get_commands({})[cmd] or vim.api.nvim_buf_get_commands(0, {})[cmd]
if not info then
return Util.error("Command `" .. cmd .. "` not found after loading " .. plugins)
vim.schedule(function()
Util.error("Command `" .. cmd .. "` not found after loading " .. plugins)
end)
return
end
command.nargs = info.nargs