aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancesco Abbate <francesco.bbt@gmail.com>2021-12-31 00:20:52 +0100
committerFrancesco Abbate <francesco.bbt@gmail.com>2021-12-31 00:20:52 +0100
commit03350cc14b44e8734af8419535a99bebea11fae6 (patch)
tree3f1cec244063bf98181a4516179d6b5146869515
parent85d26adb6276fad3e3fe6091941c9b512fb10c55 (diff)
downloadlite-xl-03350cc14b44e8734af8419535a99bebea11fae6.tar.gz
lite-xl-03350cc14b44e8734af8419535a99bebea11fae6.zip
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.
-rw-r--r--data/core/init.lua17
1 files changed, 12 insertions, 5 deletions
diff --git a/data/core/init.lua b/data/core/init.lua
index 922715c4..5d51c4cb 100644
--- a/data/core/init.lua
+++ b/data/core/init.lua
@@ -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