Closed Switch1220 closed 1 year ago
Also, due to the order of load_all_highlights()
, it doesn't reload highlights immediately.
-- M.load_all_highlights()
if g.nvchad_theme == theme1 then
g.toggle_theme_icon = " "
vim.g.nvchad_theme = theme2
require("nvchad").replace_word('theme = "' .. theme1, 'theme = "' .. theme2)
else
vim.g.nvchad_theme = theme1
g.toggle_theme_icon = " "
require("nvchad").replace_word('theme = "' .. theme2, 'theme = "' .. theme1)
end
M.load_all_highlights() -- <= I think it should be moved here
hi @Switch1220 send a PR :D , sorry i closed your previous PR without reasoning much. it was valid.
Currently,
toggle_theme()
also replaces string in thetheme_toggle
, which should not be changed.Here's example:
Before
After invoking
toggle_theme
What I did to fix this bug:
to