fix(compiler): after_loading hook

dev
nullchilly 2 years ago
parent a05ca14360
commit 19c7ec4787

@ -492,14 +492,14 @@ vim.api.nvim_create_autocmd("OptionSet", {
})
```
For people who are hybrid between light and dark mode!
#### Abnormal colors?
You need to enable [truecolor](https://wiki.archlinux.org/title/Color_output_in_console#True_color_support)
Related: [:h termguicolors](https://neovim.io/doc/user/options.html#'termguicolors'), [catppuccin/nvim#182](https://github.com/catppuccin/nvim/issues/182),
For people who are hybrid between light and dark mode!
## 💝 Thanks to
- [Pocco81](https://github.com/Pocco81)

@ -27,7 +27,7 @@ function M.load()
catppuccin.before_loading()
end
local loaded = nil
local compiled = nil
local config = require("catppuccin.config").options
if config.compile.enabled == true then
@ -40,19 +40,19 @@ function M.load()
if f ~= nil then
io.close(f)
vim.cmd("luafile " .. compiled_path)
loaded = true
compiled = true
end
end
if not loaded then -- colorscheme gets evaluated from mapper.lua
if not compiled then -- colorscheme gets evaluated from mapper.lua
require("catppuccin.lib.highlighter").load(require("catppuccin.lib.mapper").apply())
end
if catppuccin.after_loading ~= nil then
catppuccin.after_loading()
end
if catppuccin.after_loading ~= nil then
catppuccin.after_loading()
end
vim.api.nvim_exec_autocmds("User", { pattern = "CatppuccinLoaded" })
vim.api.nvim_exec_autocmds("User", { pattern = "Catppuccincompiled" })
end
function M.setup(custom_opts)

@ -49,19 +49,11 @@ vim.g.colors_name = "catppuccin"]],
table.insert(lines, fmt([[vim.api.nvim_set_hl(0, "%s", { link = "%s" })]], group, color.link))
else
if color.style then
if color.style ~= "NONE" then
if type(color.style) == "table" then
for _, style in ipairs(color.style) do
color[style] = true
end
else
color[color.style] = true
end
for _, style in ipairs(color.style) do
color[style] = true
end
end
color.style = nil
vim.api.nvim_set_hl(0, group, color)
table.insert(lines, fmt([[vim.api.nvim_set_hl(0, "%s", %s)]], group, inspect(color)))
end
end

@ -12,7 +12,6 @@ function M.highlight(group, color)
color[style] = true
end
end
color.style = nil
vim.api.nvim_set_hl(0, group, color)
end

Loading…
Cancel
Save