-
-
Notifications
You must be signed in to change notification settings - Fork 252
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(transparent-nvim): make
transparent.nvim
actually work with Hei…
…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
Showing
1 changed file
with
21 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
}, | ||
}, | ||
} |