aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancesco Abbate <francesco.bbt@gmail.com>2022-01-10 09:54:47 +0100
committerFrancesco Abbate <francesco.bbt@gmail.com>2022-01-10 09:54:47 +0100
commit4cdd42de1a5aaa62d50a9b40c8f7af4142710f9d (patch)
tree6728ad486d01ba609c81b2422cc89659d6b68cc3
parent656a89c4945aa77698ebd2462575f490e233a242 (diff)
downloadlite-xl-4cdd42de1a5aaa62d50a9b40c8f7af4142710f9d.tar.gz
lite-xl-4cdd42de1a5aaa62d50a9b40c8f7af4142710f9d.zip
Ensure config.plugins are restored on new config
When a user's or project's module configuration file is changed we make sure that the config.plugins fields are all restored so that all plugins already loaded can continue to work.
-rw-r--r--data/core/init.lua13
1 files changed, 10 insertions, 3 deletions
diff --git a/data/core/init.lua b/data/core/init.lua
index 2f1ced31..7a44f0ae 100644
--- a/data/core/init.lua
+++ b/data/core/init.lua
@@ -81,17 +81,24 @@ end
local function reload_customizations()
- core.reload_module("core.style")
+ -- The logic is:
+ -- - the core.style and config modules are reloaded with the purpose of applying
+ -- the new user's and project's module configs
+ -- - inside the core.config the existing fields in config.plugins are preserved
+ -- because they are reserved to plugins configuration and plugins are already
+ -- loaded.
+ -- - plugins are not reloaded or unloaded
local plugins_save = {}
for k, v in pairs(config.plugins) do
plugins_save[k] = v
end
+ core.reload_module("core.style")
core.reload_module("core.config")
+ core.load_user_directory()
+ core.load_project_module()
for k, v in pairs(plugins_save) do
config.plugins[k] = v
end
- core.load_user_directory()
- core.load_project_module()
end