Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(tabs): use custom separator_style in tabpages #852

Merged
merged 5 commits into from
Jun 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion lua/bufferline/tabpages.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down