diff --git a/lua/lazy/core/handler/cmd.lua b/lua/lazy/core/handler/cmd.lua index 3ebba86..a2766a4 100644 --- a/lua/lazy/core/handler/cmd.lua +++ b/lua/lazy/core/handler/cmd.lua @@ -28,10 +28,10 @@ function M:_add(plugin, cmd) end, { bang = true, nargs = "*", - complete = function() + complete = function(_, line) _load(plugin, cmd) - -- HACK: trick Neovim to show the newly loaded command completion - vim.api.nvim_input("") + -- NOTE: return the newly loaded command completion + return vim.fn.getcompletion(line, "cmdline") end, }) end