mirror of
https://github.com/gabehf/base46.git
synced 2026-03-09 15:38:15 -07:00
use replace_word func instead of changekey
This commit is contained in:
parent
45e1fff3eb
commit
2d3ebc27e5
1 changed files with 6 additions and 2 deletions
|
|
@ -158,14 +158,18 @@ M.toggle_theme = function()
|
|||
|
||||
config.ui.theme = (themes[1] == config.ui.theme and themes[2]) or themes[1]
|
||||
|
||||
require("nvchad.utils").change_key_val("theme", config.ui.theme)
|
||||
local old_theme = dofile(vim.fn.stdpath "config" .. "/lua/custom/chadrc.lua").ui.theme
|
||||
require("nvchad.utils").replace_word(old_theme, config.ui.theme)
|
||||
M.load_all_highlights()
|
||||
end
|
||||
|
||||
M.toggle_transparency = function()
|
||||
config.ui.transparency = not config.ui.transparency
|
||||
M.load_all_highlights()
|
||||
require("nvchad.utils").change_key_val("transparency", config.ui.transparency)
|
||||
|
||||
local old_transparency_val = dofile(vim.fn.stdpath "config" .. "/lua/custom/chadrc.lua").ui.transparency
|
||||
local new_transparency_val = "transparency = " .. tostring(config.ui.transparency)
|
||||
require("nvchad.utils").replace_word("transparency = " .. tostring(old_transparency_val),new_transparency_val)
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue