Skip to content

Commit

Permalink
feat: better way of dealing with lazy loaded completions (thanks to @…
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Dec 13, 2022
1 parent 4cfe0b5 commit f24c055
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lua/lazy/core/handler/cmd.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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("<space><bs><tab>")
-- NOTE: return the newly loaded command completion
return vim.fn.getcompletion(line, "cmdline")
end,
})
end
Expand Down

0 comments on commit f24c055

Please sign in to comment.