Skip to content

Commit 03419f3

Browse files
committed
fix(cmd): shedule error message instead of showing directly
1 parent 7613ab2 commit 03419f3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lua/lazy/core/handler/cmd.lua

+4-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ function M:_add(cmd)
3535

3636
local info = vim.api.nvim_get_commands({})[cmd] or vim.api.nvim_buf_get_commands(0, {})[cmd]
3737
if not info then
38-
return Util.error("Command `" .. cmd .. "` not found after loading " .. plugins)
38+
vim.schedule(function()
39+
Util.error("Command `" .. cmd .. "` not found after loading " .. plugins)
40+
end)
41+
return
3942
end
4043

4144
command.nargs = info.nargs

0 commit comments

Comments
 (0)