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, {
|
end, {
|
||||||
bang = true,
|
bang = true,
|
||||||
nargs = "*",
|
nargs = "*",
|
||||||
complete = function()
|
complete = function(_, line)
|
||||||
_load(plugin, cmd)
|
_load(plugin, cmd)
|
||||||
-- HACK: trick Neovim to show the newly loaded command completion
|
-- NOTE: return the newly loaded command completion
|
||||||
vim.api.nvim_input("<space><bs><tab>")
|
return vim.fn.getcompletion(line, "cmdline")
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue