mirror of https://github.com/folke/lazy.nvim.git
fix(cmd): properly deal with commands with nargs=? or nargs=1. Fixes #659
This commit is contained in:
parent
b4b11f48aa
commit
efe36bdfda
|
@ -29,6 +29,13 @@ function M:_add(cmd)
|
|||
end
|
||||
|
||||
self:_load(cmd)
|
||||
|
||||
local info = vim.api.nvim_get_commands({})[cmd]
|
||||
command.nargs = info.nargs
|
||||
if event.args and event.args ~= "" and info.nargs and info.nargs:find("[1?]") then
|
||||
command.args = { event.args }
|
||||
end
|
||||
|
||||
vim.cmd(command)
|
||||
end, {
|
||||
bang = true,
|
||||
|
|
Loading…
Reference in New Issue