Skip to content

Commit

Permalink
feat: use transparent bg when Normal hl group not having bg (folke#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
shiradofu authored Feb 1, 2023
1 parent 2c8f9f3 commit 00b0e0f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lua/zen-mode/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,13 @@ M.options = {}
function M.colors(options)
options = options or M.options
local normal = util.get_hl("Normal")
if normal and normal.background then
local bg = util.darken(normal.background, options.window.backdrop)
vim.cmd(("highlight ZenBg guibg=%s guifg=%s"):format(bg, bg))
if normal then
if normal.background then
local bg = util.darken(normal.background, options.window.backdrop)
vim.cmd(("highlight ZenBg guibg=%s guifg=%s"):format(bg, bg))
else
vim.cmd("highlight link ZenBg Normal")
end
end
end

Expand Down

0 comments on commit 00b0e0f

Please sign in to comment.