Skip to content

Commit

Permalink
fix(transparent-nvim): make transparent.nvim actually work with Hei…
Browse files Browse the repository at this point in the history
…rline (also makes the `opts` table work as well) (#1149)

* fix(transparent-nvim): use `opts` table so the user can extend options

* fix(transparent-nvim): use new autocmd event to make sure Heirline gets updated
  • Loading branch information
mehalter authored Aug 9, 2024
1 parent d252a62 commit ece293a
Showing 1 changed file with 21 additions and 14 deletions.
35 changes: 21 additions & 14 deletions lua/astrocommunity/color/transparent-nvim/init.lua
Original file line number Diff line number Diff line change
@@ -1,28 +1,35 @@
return {
"xiyaowong/transparent.nvim",
lazy = false,
config = function()
opts = {
extra_groups = {
"NormalFloat",
"NvimTreeNormal",
},
},
config = function(_, opts)
local transparent = require "transparent"
transparent.setup {
extra_groups = {
"NormalFloat",
"NvimTreeNormal",
},
}
transparent.setup(opts)
transparent.clear_prefix "BufferLine"
transparent.clear_prefix "NeoTree"
transparent.clear_prefix "lualine"
end,
dependencies = {
{
"AstroNvim/astrocore",
opts = {
mappings = {
n = {
["<Leader>uT"] = { "<Cmd>TransparentToggle<CR>", desc = "Toggle transparency" },
},
},
},
opts = function(_, opts)
opts.mappings.n["<Leader>uT"] = { "<Cmd>TransparentToggle<CR>", desc = "Toggle transparency" }
if vim.tbl_get(opts, "autocmds", "heirline_colors") then
table.insert(opts.autocmds.heirline_colors, {
event = "User",
pattern = "TransparentClear",
desc = "Refresh heirline colors",
callback = function()
if package.loaded["heirline"] then require("astroui.status.heirline").refresh_colors() end
end,
})
end
end,
},
},
}

0 comments on commit ece293a

Please sign in to comment.