mirror of https://github.com/folke/lazy.nvim.git
feat: better way of dealing with lazy loaded completions (thanks to @lewis6991)
This commit is contained in:
parent
4cfe0b5315
commit
f24c055fe9
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue