From 9ca364d488b98894ca780c40aae9ea63967c8fcf Mon Sep 17 00:00:00 2001 From: Jackie Li Date: Wed, 6 Dec 2023 07:40:39 +0000 Subject: [PATCH] fix: use link if specified in custom areas (#839) --- lua/bufferline/custom_area.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lua/bufferline/custom_area.lua b/lua/bufferline/custom_area.lua index 17bf5924..1cb1d95a 100644 --- a/lua/bufferline/custom_area.lua +++ b/lua/bufferline/custom_area.lua @@ -11,9 +11,12 @@ local fmt = string.format ---generate a custom highlight group ---@param index integer ---@param side string ----@param section {fg: string, bg: string, text: string} +---@param section {fg: string, bg: string, text: string, link: string} ---@param bg string? local function create_hl(index, side, section, bg) + if section.link then + return highlights.hl(section.link) + end local name = fmt("BufferLine%sCustomAreaText%d", side:gsub("^%l", string.upper), index) section.bg = section.bg or bg section.default = true -- We need to be able to constantly override these highlights so they should always be default