From e8af06e04f266d573cd061003c7790548d50f77a Mon Sep 17 00:00:00 2001 From: Benny Powers Date: Mon, 6 Jun 2022 13:44:30 +0300 Subject: [PATCH] fix: bufferline integration w transparent_background --- .../core/integrations/bufferline.lua | 40 ++++++++++--------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/lua/catppuccin/core/integrations/bufferline.lua b/lua/catppuccin/core/integrations/bufferline.lua index 5819ca1..a2c4a0a 100644 --- a/lua/catppuccin/core/integrations/bufferline.lua +++ b/lua/catppuccin/core/integrations/bufferline.lua @@ -1,27 +1,29 @@ local M = {} function M.get(cp) + local transparent_background = require("catppuccin.config").options.transparent_background + local bg_highlight = transparent_background and "NONE" or cp.base - local inactive_bg = cp.mantle + local inactive_bg = transparent_background and "NONE" or cp.mantle - return { - BufferLineFill = { bg = cp.crust }, - BufferLineBackcrust = { fg = cp.text, bg = inactive_bg }, -- others - BufferLineBufferVisible = { fg = cp.surface1, bg = inactive_bg }, - BufferLineBufferSelected = { fg = cp.text, bg = cp.base, style = "bold,italic" }, -- current - BufferLineTab = { fg = cp.surface1, bg = cp.base }, - BufferLineTabSelected = { fg = cp.red, bg = cp.blue }, - BufferLineTabClose = { fg = cp.red, bg = inactive_bg }, - BufferLineIndicatorSelected = { fg = cp.peach, bg = cp.base }, - -- separators - BufferLineSeparator = { fg = inactive_bg, bg = inactive_bg }, - BufferLineSeparatorVisible = { fg = inactive_bg, bg = inactive_bg }, - BufferLineSeparatorSelected = { fg = inactive_bg, bg = inactive_bg }, - -- close buttons - BufferLineCloseButton = { fg = cp.surface1, bg = inactive_bg }, - BufferLineCloseButtonVisible = { fg = cp.surface1, bg = inactive_bg }, - BufferLineCloseButtonSelected = { fg = cp.red, bg = cp.base }, - } + return { + BufferLineFill = { bg = bg_highlight }, + BufferLineBackcrust = { fg = cp.text, bg = inactive_bg }, -- others + BufferLineBufferVisible = { fg = cp.surface1, bg = inactive_bg }, + BufferLineBufferSelected = { fg = cp.text, bg = cp.base, style = "bold,italic" }, -- current + BufferLineTab = { fg = cp.surface1, bg = cp.base }, + BufferLineTabSelected = { fg = cp.red, bg = cp.blue }, + BufferLineTabClose = { fg = cp.red, bg = inactive_bg }, + BufferLineIndicatorSelected = { fg = cp.peach, bg = cp.base }, + -- separators + BufferLineSeparator = { fg = inactive_bg, bg = inactive_bg }, + BufferLineSeparatorVisible = { fg = inactive_bg, bg = inactive_bg }, + BufferLineSeparatorSelected = { fg = inactive_bg, bg = inactive_bg }, + -- close buttons + BufferLineCloseButton = { fg = cp.surface1, bg = inactive_bg }, + BufferLineCloseButtonVisible = { fg = cp.surface1, bg = inactive_bg }, + BufferLineCloseButtonSelected = { fg = cp.red, bg = cp.base }, + } end return M