should've tested the changes, nvim_create_usercommand doesn't like...
unkown options
This commit is contained in:
@ -37,8 +37,10 @@ end
|
|||||||
function lazy_loader:cmd(name, opts)
|
function lazy_loader:cmd(name, opts)
|
||||||
opts = opts or {}
|
opts = opts or {}
|
||||||
|
|
||||||
-- rerun is on by default
|
-- move the rerun arg to a seperate variable because keymap.set doesn't like
|
||||||
opts["rerun"] = opts["rerun"] or true
|
-- options it doesn't know of
|
||||||
|
local rerun = opts["rerun"] or true
|
||||||
|
opts['rerun'] = nil
|
||||||
|
|
||||||
-- load the plugin on completion
|
-- load the plugin on completion
|
||||||
if not opts["complete"] then
|
if not opts["complete"] then
|
||||||
@ -57,7 +59,7 @@ function lazy_loader:cmd(name, opts)
|
|||||||
self:cleanup()
|
self:cleanup()
|
||||||
|
|
||||||
-- attempt to rerun the command
|
-- attempt to rerun the command
|
||||||
if not opts["rerun"] then
|
if not rerun then
|
||||||
pcall(vim.cmd, name)
|
pcall(vim.cmd, name)
|
||||||
end
|
end
|
||||||
end, opts)
|
end, opts)
|
||||||
|
Reference in New Issue
Block a user