zenbones.nvim icon indicating copy to clipboard operation
zenbones.nvim copied to clipboard

Make `Folded` transparent as well if transparency is enabled

Open wimstefan opened this issue 1 year ago โ€ข 3 comments

The title says it all. It doesn't look consistent if everything has a transparent background except the folds. Would be a nice extra to have a consistent appearance ๐Ÿ˜

wimstefan avatar Aug 11 '22 10:08 wimstefan

Since even I could resolve that with a simple change I can provide a patch ๐Ÿ˜

diff --git a/lua/zenbones/specs/dark.lua b/lua/zenbones/specs/dark.lua
index 00d7dc2..226d66b 100644
--- a/lua/zenbones/specs/dark.lua
+++ b/lua/zenbones/specs/dark.lua
@@ -68,7 +68,7 @@ local function generate(p, opt)
      LineNr          { fg = p1.bg.li(opt.lighten_line_nr or 35), bg = opt.solid_line_nr and p1.bg.li(4) or "NONE" }, -- Line number for ":number" and ":#" commands, and when 'number' or 'relativenumber' option is set.
      SignColumn      { LineNr }, -- column where |signs| are displayed
      FoldColumn      { LineNr, gui = "bold" }, -- 'foldcolumn'
-     Folded          { bg = p1.bg.li(14), fg = p1.bg.li(64) }, -- line used for closed folds
+     Folded          { bg = not opt.transparent_background and p1.bg.li(14) or "NONE", fg = p1.bg.li(64) }, -- line used for closed folds
      CursorLineNr    { LineNr, fg = p.fg, gui = "bold" }, -- Like LineNr when 'cursorline' or 'relativenumber' is set for the cursor line.
 
      -- ModeMsg      { }, -- 'showmode' message (e.g., "-- INSERT -- ")
diff --git a/lua/zenbones/specs/light.lua b/lua/zenbones/specs/light.lua
index 8318ef0..579d8da 100644
--- a/lua/zenbones/specs/light.lua
+++ b/lua/zenbones/specs/light.lua
@@ -68,7 +68,7 @@ local function generate(p, opt)
      LineNr          { fg = p1.bg.da(opt.darken_line_nr or 33), bg = opt.solid_line_nr and p1.bg.da(4) or "NONE" }, -- Line number for ":number" and ":#" commands, and when 'number' or 'relativenumber' option is set.
      SignColumn      { LineNr }, -- column where |signs| are displayed
      FoldColumn      { LineNr, gui = "bold" }, -- 'foldcolumn'
-     Folded          { bg = p1.bg.da(16), fg = p1.bg.da(64) }, -- line used for closed folds
+     Folded          { bg = not opt.transparent_background and p1.bg.da(16) or "NONE", fg = p1.bg.da(64) }, -- line used for closed folds
      CursorLineNr    { LineNr, fg = p.fg, gui = "bold" }, -- Like LineNr when 'cursorline' or 'relativenumber' is set for the cursor line.
 
      -- ModeMsg      { }, -- 'showmode' message (e.g., "-- INSERT -- ")

wimstefan avatar Aug 11 '22 10:08 wimstefan

Yes, please create a PR ๐Ÿ˜„ Would also be great to see a before/after comparison.

mcchrish avatar Aug 11 '22 11:08 mcchrish

Uhhhh I'm afraid that's beyond my possibilities ๐Ÿคจ I was hoping a simple patch as seen above would be enough. Comparisons are also not that easy since I'm using a folding plugin that might show a different picture than default folds.

wimstefan avatar Aug 11 '22 13:08 wimstefan

Thank you so much!!! ๐Ÿ˜ƒ

wimstefan avatar Sep 19 '22 13:09 wimstefan