Use doc on_save hooks to reload user module

This commit is contained in:
Francesco Abbate
2021-02-17 20:10:39 +01:00
parent 1ce1c114ba
commit 9b27180267
2 changed files with 23 additions and 4 deletions
+1 -4
View File
@@ -67,10 +67,7 @@ end
local function save(filename)
doc():save(filename)
if doc().filename == common.normalize_path(USERDIR .. PATHSEP .. "init.lua") then
core.reload_module("core.style")
core.load_user_directory()
end
core.on_doc_save(filename)
core.log("Saved \"%s\"", doc().filename)
end