Skip to content

Commit

Permalink
fix(cmd): shedule error message instead of showing directly
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Oct 17, 2023
1 parent 7613ab2 commit 03419f3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lua/lazy/core/handler/cmd.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 03419f3

Please sign in to comment.