aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjgmdev <jgmdev@gmail.com>2022-03-06 21:58:11 -0400
committerjgmdev <jgmdev@gmail.com>2022-03-06 21:58:11 -0400
commit8ec16dd695c1a6750695b087f56e329f3b8f823e (patch)
tree02bcabb9e7192897d6912e5d32d330112ce1dc75
parentb0af3b0813a7c7b48cfbca0d1b00b5d16fb2ab24 (diff)
downloadlite-xl-plugins-8ec16dd695c1a6750695b087f56e329f3b8f823e.tar.gz
lite-xl-plugins-8ec16dd695c1a6750695b087f56e329f3b8f823e.zip
select_colorscheme: fix trying to load empty color scheme.
-rw-r--r--plugins/select_colorscheme.lua8
1 files changed, 5 insertions, 3 deletions
diff --git a/plugins/select_colorscheme.lua b/plugins/select_colorscheme.lua
index f20d949..1e25bc4 100644
--- a/plugins/select_colorscheme.lua
+++ b/plugins/select_colorscheme.lua
@@ -61,7 +61,7 @@ function Settings:get_color_scheme()
end
local function make_color_module_name(name)
- return (name == color_default.name) and color_default.module or "colors."..name
+ return (name == color_default.name) and color_default.module or "colors."..name
end
function Settings:change_color(name)
@@ -83,8 +83,10 @@ function Settings:load_settings()
local fp = io.open(PATH_CONFIG, "r")
if fp then
local name = fp:read("*a")
- core.reload_module(make_color_module_name(name))
- Settings.color_scheme = name
+ if name and name ~= "" then
+ core.reload_module(make_color_module_name(name))
+ Settings.color_scheme = name
+ end
fp:close()
end
end