From 0054aeb3d10f73a111755cbb851f6fb09e23f501 Mon Sep 17 00:00:00 2001 From: Luco Bellic Date: Tue, 23 Jan 2024 19:39:13 +0100 Subject: [PATCH] fix(tabs): use custom separator_style in tabpages --- lua/bufferline/tabpages.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lua/bufferline/tabpages.lua b/lua/bufferline/tabpages.lua index 9693af32..61822595 100644 --- a/lua/bufferline/tabpages.lua +++ b/lua/bufferline/tabpages.lua @@ -16,11 +16,15 @@ local padding = constants.padding local function tab_click_component(num) return "%" .. num .. "T" end +---@param tabpage { tabnr: number, variables: { name: string }, windows: number[] } +---@param is_active boolean +---@param style string | { [1]: string, [2]: string } +---@param highlights bufferline.Highlights local function render(tabpage, is_active, style, highlights) local h = highlights local hl = is_active and h.tab_selected.hl_group or h.tab.hl_group local separator_hl = is_active and h.tab_separator_selected.hl_group or h.tab_separator.hl_group - local chars = constants.sep_chars[style] or constants.sep_chars.thin + local chars = type(style) == "table" and style or constants.sep_chars[style] or constants.sep_chars.thin local name = padding .. (tabpage.variables.name or tabpage.tabnr) .. padding local char_order = ({ thick = { 1, 2 }, thin = { 1, 2 } })[style] or { 2, 1 } return {