From 03419f3e5f7590194d599aa8a1a7a7841409d141 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 17 Oct 2023 16:52:32 +0200 Subject: [PATCH] fix(cmd): shedule error message instead of showing directly --- lua/lazy/core/handler/cmd.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lua/lazy/core/handler/cmd.lua b/lua/lazy/core/handler/cmd.lua index ef7a2bd..658c957 100644 --- a/lua/lazy/core/handler/cmd.lua +++ b/lua/lazy/core/handler/cmd.lua @@ -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