diff --git a/lua/dep/lazy/loader/init.lua b/lua/dep/lazy/loader/init.lua index c901b0a..0603aa1 100644 --- a/lua/dep/lazy/loader/init.lua +++ b/lua/dep/lazy/loader/init.lua @@ -37,8 +37,10 @@ end function lazy_loader:cmd(name, opts) opts = opts or {} - -- rerun is on by default - opts["rerun"] = opts["rerun"] or true + -- move the rerun arg to a seperate variable because keymap.set doesn't like + -- options it doesn't know of + local rerun = opts["rerun"] or true + opts['rerun'] = nil -- load the plugin on completion if not opts["complete"] then @@ -57,7 +59,7 @@ function lazy_loader:cmd(name, opts) self:cleanup() -- attempt to rerun the command - if not opts["rerun"] then + if not rerun then pcall(vim.cmd, name) end end, opts)