use autocmd event instead of `after_loading` hook

dev
Zhong Liu 2 years ago
parent 37e99450cf
commit 357dc37911

@ -13,19 +13,14 @@ end
function M.get(cp) function M.get(cp)
if not get_prepared() then if not get_prepared() then
local catppuccin = require("catppuccin") set_prepared(vim.api.nvim_create_autocmd("User", {
if catppuccin.after_loading ~= nil then pattern = "CatppuccinLoaded",
local callback = catppuccin.after_loading callback = function ()
catppuccin.after_loading = function () if pcall(require, "lightspeed") then
callback() require("lightspeed").init_highlight()
require'lightspeed'.init_highlight() end
end end
else }))
catppuccin.after_loading = function ()
require'lightspeed'.init_highlight()
end
end
set_prepared(true)
end end
return { return {

Loading…
Cancel
Save