Restore config.plugins when reloading config

Some plugins store options in:

config.plugins.<plugin-name>

so we restore all the kay-values of config.plugins when
reloading the user preferences.
This commit is contained in:
Francesco Abbate 2021-12-31 00:20:52 +01:00
parent 85d26adb62
commit 03350cc14b
1 changed files with 12 additions and 5 deletions

View File

@ -81,11 +81,18 @@ end
local function reload_customizations()
core.reload_module("core.style")
core.reload_module("core.config")
core.reload_module("core.keymap")
core.load_user_directory()
core.load_project_module()
core.reload_module("core.style")
core.reload_module("core.keymap")
local plugins_save = {}
for k, v in pairs(config.plugins) do
plugins_save[k] = v
end
core.reload_module("core.config")
for k, v in pairs(plugins_save) do
config.plugins[k] = v
end
core.load_user_directory()
core.load_project_module()
end