diff --git a/lua/catppuccin/core/integrations/bufferline.lua b/lua/catppuccin/core/integrations/bufferline.lua index bf17205..c4f9128 100644 --- a/lua/catppuccin/core/integrations/bufferline.lua +++ b/lua/catppuccin/core/integrations/bufferline.lua @@ -14,7 +14,7 @@ function M.get(cp) 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 + 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 }, diff --git a/lua/catppuccin/core/integrations/hop.lua b/lua/catppuccin/core/integrations/hop.lua index 72cd3cf..f4ed799 100644 --- a/lua/catppuccin/core/integrations/hop.lua +++ b/lua/catppuccin/core/integrations/hop.lua @@ -2,9 +2,9 @@ local M = {} function M.get(cp) return { - HopNextKey = { bg = cp.base, fg = cp.peach, style = "bold,underline" }, + HopNextKey = { bg = cp.base, fg = cp.peach, style = { "bold", "underline" } }, HopNextKey1 = { bg = cp.base, fg = cp.blue, style = "bold" }, - HopNextKey2 = { bg = cp.base, fg = cp.teal, style = "bold,italic" }, + HopNextKey2 = { bg = cp.base, fg = cp.teal, style = { "bold", "italic" } }, HopUnmatched = { bg = cp.base, fg = cp.overlay0 }, } end diff --git a/lua/catppuccin/core/integrations/mini.lua b/lua/catppuccin/core/integrations/mini.lua index ad2c2c9..4280394 100644 --- a/lua/catppuccin/core/integrations/mini.lua +++ b/lua/catppuccin/core/integrations/mini.lua @@ -17,7 +17,7 @@ function M.get(cp) MiniJump = { fg = cp.overlay2, bg = cp.pink }, - MiniJump2dSpot = { bg = cp.base, fg = cp.peach, style = "bold,underline" }, + MiniJump2dSpot = { bg = cp.base, fg = cp.peach, style = { "bold", "underline" } }, MiniStarterCurrent = {}, MiniStarterFooter = { fg = cp.yellow, style = "italic" }, @@ -42,10 +42,10 @@ function M.get(cp) MiniSurround = { bg = cp.pink, fg = cp.surface1 }, - MiniTablineCurrent = { fg = cp.text, bg = cp.base, style = "bold,italic" }, + MiniTablineCurrent = { fg = cp.text, bg = cp.base, style = { "bold", "italic" } }, MiniTablineFill = { bg = bg_highlight }, MiniTablineHidden = { fg = cp.text, bg = inactive_bg }, - MiniTablineModifiedCurrent = { fg = cp.base, bg = cp.text, style = "bold,italic" }, + MiniTablineModifiedCurrent = { fg = cp.base, bg = cp.text, style = { "bold", "italic" } }, MiniTablineModifiedHidden = { fg = inactive_bg, bg = cp.text }, MiniTablineModifiedVisible = { fg = cp.surface1, bg = cp.subtext1 }, MiniTablineTabpagesection = { fg = cp.surface1, bg = cp.base }, diff --git a/lua/catppuccin/core/integrations/treesitter.lua b/lua/catppuccin/core/integrations/treesitter.lua index 2ed684c..3340774 100644 --- a/lua/catppuccin/core/integrations/treesitter.lua +++ b/lua/catppuccin/core/integrations/treesitter.lua @@ -80,7 +80,7 @@ function M.get(cp) -- TSURI = { }; -- Any URI like a link or email. -- -- Markdown tresitter parser support - TSURI = { fg = cp.rosewater, style = "italic,underline" }, -- urls, links and emails + TSURI = { fg = cp.rosewater, style = { "italic", "underline" } }, -- urls, links and emails TSLiteral = { fg = cp.teal, style = "italic" }, -- used for inline code in markdown and for doc in python (""") TSTextReference = { fg = cp.lavender, style = "bold" }, -- references TSTitle = { fg = cp.blue, style = "bold" }, -- titles like: # Example diff --git a/lua/catppuccin/core/mapper.lua b/lua/catppuccin/core/mapper.lua index 2f1f29c..3359662 100644 --- a/lua/catppuccin/core/mapper.lua +++ b/lua/catppuccin/core/mapper.lua @@ -34,7 +34,7 @@ local function get_base() }, -- Screen-line at the cursor, when 'cursorline' is secp. Low-priority if forecrust (ctermfg OR guifg) is not secp. Directory = { fg = cp.blue }, -- directory names (and other special names in listings) EndOfBuffer = { fg = cp.base }, -- filler lines (~) after the end of the buffer. By default, this is highlighted like |hl-NonText|. - ErrorMsg = { fg = cp.red, style = "bold,italic" }, -- error messages on the command line + ErrorMsg = { fg = cp.red, style = { "bold", "italic" } }, -- error messages on the command line VertSplit = { fg = cp.crust }, -- the column separating vertically split windows Folded = { fg = cp.blue, bg = cp.surface1 }, -- line used for closed folds FoldColumn = { bg = cp.base, fg = cp.overlay0 }, -- 'foldcolumn' diff --git a/lua/catppuccin/utils/data.lua b/lua/catppuccin/utils/data.lua index 3be43a8..241f04f 100644 --- a/lua/catppuccin/utils/data.lua +++ b/lua/catppuccin/utils/data.lua @@ -8,13 +8,4 @@ function M.set_of(list) return set end --- https://www.codegrepper.com/code-examples/lua/lua+split+string+on+comma -function M.split(s, delimiter) - local result = {} - for match in (s..delimiter):gmatch("(.-)"..delimiter) do - table.insert(result, match) - end - return result -end - return M diff --git a/lua/catppuccin/utils/util.lua b/lua/catppuccin/utils/util.lua index 38b3f3a..be3e05b 100644 --- a/lua/catppuccin/utils/util.lua +++ b/lua/catppuccin/utils/util.lua @@ -1,9 +1,6 @@ -local udata = require("catppuccin.utils.data") - local g = vim.g local util = {} - local has_nvim07 = vim.fn.has("nvim-0.7") function util.highlight(group, color) @@ -15,8 +12,12 @@ function util.highlight(group, color) else if color.style then if color.style ~= "NONE" then - for _, style in pairs(udata.split(color.style, ",")) do - color[style] = true + if type(color.style) == "table" then + for _, style in ipairs(color.style) do + color[style] = true + end + else + color[color.style] = true end end end @@ -26,6 +27,9 @@ function util.highlight(group, color) end else -- Doc: :h highlight-gui + if color.style and type(color.style) == "table" then + color.style = table.concat(color.style, ",") + end local style = color.style and "gui=" .. color.style or "gui=NONE" local fg = color.fg and "guifg=" .. color.fg or "guifg=NONE" local bg = color.bg and "guibg=" .. color.bg or "guibg=NONE"