aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjgmdev <jgmdev@gmail.com>2023-02-15 22:22:50 -0400
committerjgmdev <jgmdev@gmail.com>2023-02-15 22:22:50 -0400
commitd957a57209ee4f62911b6278c054803ac5a1b9d6 (patch)
treea800aa8088b54ab21f1e92821dceb932eba1a7d3
parentd2cb48da2028c211938434b66b89ae54659f7218 (diff)
downloadlite-xl-plugins-d957a57209ee4f62911b6278c054803ac5a1b9d6.tar.gz
lite-xl-plugins-d957a57209ee4f62911b6278c054803ac5a1b9d6.zip
settings: simplified loaded status check of plugins
-rw-r--r--manifest.json2
-rw-r--r--plugins/settings.lua8
2 files changed, 3 insertions, 7 deletions
diff --git a/manifest.json b/manifest.json
index 41f3c4a..c3279d9 100644
--- a/manifest.json
+++ b/manifest.json
@@ -1107,7 +1107,7 @@
},
{
"description": "Provides a GUI to manage core and plugin settings, bindings and select color theme *([video](https://user-images.githubusercontent.com/1702572/169743674-ececae24-f6b7-4ff2-bfa2-c4762cd327d9.mp4))*. (depends on [`widget`](https://github.com/lite-xl/lite-xl-widgets))",
- "version": "0.5",
+ "version": "0.6",
"path": "plugins/settings.lua",
"id": "settings",
"mod_version": "3",
diff --git a/plugins/settings.lua b/plugins/settings.lua
index d3af077..6be6112 100644
--- a/plugins/settings.lua
+++ b/plugins/settings.lua
@@ -1867,11 +1867,7 @@ function core.run()
-- load plugins disabled by default and enabled by user
if settings.config.enabled_plugins then
for name, _ in pairs(settings.config.enabled_plugins) do
- if
- type(config.plugins[name]) == "boolean"
- and
- not config.plugins[name]
- then
+ if not config.plugins[name] then
require("plugins." .. name)
end
end
@@ -1910,7 +1906,7 @@ load_settings()
-- only disable non already loaded plugins
if settings.config.disabled_plugins then
for name, _ in pairs(settings.config.disabled_plugins) do
- if type(rawget(config.plugins, name)) == "nil" then
+ if not package.loaded[name] then
config.plugins[name] = false
end
end