aboutsummaryrefslogtreecommitdiff
path: root/lua/luatab/init.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/luatab/init.lua')
-rw-r--r--lua/luatab/init.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/lua/luatab/init.lua b/lua/luatab/init.lua
index 2141bbc..597af3a 100644
--- a/lua/luatab/init.lua
+++ b/lua/luatab/init.lua
@@ -44,13 +44,17 @@ local function tabDevicon(bufnr, isSelected)
dev, devhl = require'nvim-web-devicons'.get_icon(file, vim.fn.getbufvar(bufnr, '&filetype'))
end
if dev then
- return (isSelected and '%#'..devhl..'#' or '') .. dev .. (isSelected and '%#TabLineSel#' or '')
+ local h = require'luatab.highlight'
+ local fg = h.extract_highlight_colors(devhl, 'fg')
+ local bg = h.extract_highlight_colors('TabLineSel', 'bg')
+ local hl = h.create_component_highlight_group({bg = bg, fg = fg}, devhl)
+ return (isSelected and '%#'..hl..'#' or '') .. dev .. (isSelected and '%#TabLineSel#' or '') .. ' '
end
return ''
end
local function tabSeparator(current)
- return ' ' .. (current < vim.fn.tabpagenr('$') and '%#TabLine#|' or '')
+ return (current < vim.fn.tabpagenr('$') and '%#TabLine#|' or '')
end
local function formatTab(current)