From d957a57209ee4f62911b6278c054803ac5a1b9d6 Mon Sep 17 00:00:00 2001 From: jgmdev Date: Wed, 15 Feb 2023 22:22:50 -0400 Subject: settings: simplified loaded status check of plugins --- plugins/settings.lua | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'plugins') 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 -- cgit v1.2.3