Skip to content

Commit

Permalink
fix: allow chadrc to be a module (#342)
Browse files Browse the repository at this point in the history
  • Loading branch information
mehalter authored Oct 4, 2024
1 parent d5a768e commit 898a0ed
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lua/base46/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,8 @@ M.toggle_theme = function()

opts.theme = (themes[1] == opts.theme and themes[2]) or themes[1]

local chadrc = dofile(vim.fn.stdpath "config" .. "/lua/chadrc.lua")
package.loaded.chadrc = nil
local chadrc = require "chadrc"
local old_theme = chadrc.base46.theme

require("nvchad.utils").replace_word('theme = "' .. old_theme, 'theme = "' .. opts.theme)
Expand All @@ -208,7 +209,8 @@ M.toggle_transparency = function()
opts.transparency = not opts.transparency
M.load_all_highlights()

local old = dofile(vim.fn.stdpath "config" .. "/lua/chadrc.lua").transparency
package.loaded.chadrc = nil
local old = require("chadrc").transparency
local new = "transparency = " .. tostring(opts.transparency)
require("nvchad.utils").replace_word("transparency = " .. tostring(old), new)
end
Expand Down

0 comments on commit 898a0ed

Please sign in to comment.