diff --git a/lua/colors/highlights.lua b/lua/colors/highlights.lua index 1c3dae8..d9f2616 100644 --- a/lua/colors/highlights.lua +++ b/lua/colors/highlights.lua @@ -1,6 +1,5 @@ local cmd = vim.cmd -local override = require("core.utils").load_config().ui.hl_override local colors = require("colors").get() local ui = require("core.utils").load_config().ui @@ -167,7 +166,3 @@ if ui.transparency then fg("TelescopeBorder", one_bg) fg_bg("TelescopeResultsTitle", black, blue) end - -if #override ~= 0 then - require(override) -end diff --git a/lua/colors/init.lua b/lua/colors/init.lua index b3917ca..a41533b 100644 --- a/lua/colors/init.lua +++ b/lua/colors/init.lua @@ -1,3 +1,6 @@ +local colors = require("core.utils").load_config().ui.colors +local override = require("core.utils").load_config().ui.hl_override + local M = {} -- if theme given, load given theme if given, otherwise nvchad_theme @@ -27,12 +30,15 @@ M.init = function(theme) else pcall(vim.cmd, "colo " .. theme) end + + if #override ~= 0 then + package.loaded[override] = nil + require(override) + end end -- returns a table of colors for given or current theme M.get = function(theme) - local colors = require("core.utils").load_config().ui.colors - if #colors ~= 0 then return require(colors) else