Skip to content

Commit

Permalink
feat(win): added default hl groups for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Nov 6, 2024
1 parent 2bf3691 commit 8c0f10b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lua/snacks/win.lua
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ local defaults = {
position = "float",
minimal = true,
wo = {
winhighlight = "Normal:NormalFloat,NormalNC:NormalFloat",
winhighlight = "Normal:SnacksNormal,NormalNC:SnacksWinBarNC,WinBar:SnacksWinBar,WinBarNC:SnacksWinBarNC",
},
bo = {},
keys = {
Expand Down Expand Up @@ -117,7 +117,11 @@ local win_opts = {
"zindex",
}

vim.api.nvim_set_hl(0, "SnacksWinBackdrop", { bg = "#000000", default = true })
vim.api.nvim_set_hl(0, "SnacksBackdrop", { bg = "#000000", default = true })
vim.api.nvim_set_hl(0, "SnacksNormal", { link = "NormalFloat", default = true })
vim.api.nvim_set_hl(0, "SnacksNormalNC", { link = "NormalFloat", default = true })
vim.api.nvim_set_hl(0, "SnacksWinBar", { link = "Title", default = true })
vim.api.nvim_set_hl(0, "SnacksWinBarNC", { link = "SnacksWinBar", default = true })

local id = 0

Expand Down Expand Up @@ -394,7 +398,7 @@ function M:drop()
focusable = false,
zindex = self.opts.zindex - 1,
wo = {
winhighlight = "Normal:SnacksWinBackdrop",
winhighlight = "Normal:SnacksBackdrop",
winblend = self.opts.backdrop,
},
bo = {
Expand Down

0 comments on commit 8c0f10b

Please sign in to comment.