feat: better way of dealing with lazy loaded completions (thanks to @lewis6991)

This commit is contained in:
Folke Lemaitre 2022-12-13 09:48:17 +01:00
parent 4cfe0b5315
commit f24c055fe9
No known key found for this signature in database
GPG Key ID: 41F8B1FBACAE2040
1 changed files with 3 additions and 3 deletions

View File

@ -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