aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
authorSquibid <me@zacharyscheiman.com>2024-07-25 20:01:23 -0400
committerSquibid <me@zacharyscheiman.com>2024-07-25 20:01:23 -0400
commit30e7e057718973c86e3dc811c21000ce9a5c2050 (patch)
tree0db51f62bb581b20f1532754f594f9d8fce431aa /lua
parentd7a08ca8205817589e90050ec20ea06591035526 (diff)
downloaddep-30e7e057718973c86e3dc811c21000ce9a5c2050.tar.gz
dep-30e7e057718973c86e3dc811c21000ce9a5c2050.tar.bz2
dep-30e7e057718973c86e3dc811c21000ce9a5c2050.zip
make sure the load function is called on dep reloading
Diffstat (limited to 'lua')
-rw-r--r--lua/dep.lua13
1 files changed, 12 insertions, 1 deletions
diff --git a/lua/dep.lua b/lua/dep.lua
index c6deb9f..378ef82 100644
--- a/lua/dep.lua
+++ b/lua/dep.lua
@@ -11,7 +11,7 @@ local logger = require("dep.log").global
local proc = require("dep.proc")
local initialized, perf, config_path, base_dir
-local packages, root
+local packages, root, load
local function bench(name, code, ...)
local start = os.clock()
@@ -396,6 +396,16 @@ local function reload()
end
local function reload_all()
+ -- recall the load function
+ if load and type(load) == "function" then
+ local ok, ret = pcall(load)
+ if ok and type(ret) == "table" then
+ register_recursive(ret)
+ else
+ logger:log("error", ret)
+ end
+ end
+
for i = 1, #packages do
local package = packages[i]
package.loaded, package.subtree_loaded = false, false
@@ -832,6 +842,7 @@ return setmetatable({
if config["load"] and type(config["load"]) == "function" then
local ok, ret = pcall(config["load"])
if ok and type(ret) == "table" then
+ load = config["load"]
register_recursive(ret)
else
logger:log("error", ret)