blob: 44fae45467f1568e07d15f9e6c84ad21f9f7715d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
local M = {}
local fmt = function(name, context)
local buflist = vim.fn.tabpagebuflist(context.tabnr)
local current_tab = vim.api.nvim_get_current_tabpage()
local winnr = vim.fn.tabpagewinnr(context.tabnr)
local bufnr = buflist[winnr]
local mod = vim.fn.getbufvar(bufnr, '&mod')
local icon = require('nvim-web-devicons').get_icon(name)
if icon == nil then
icon = ''
else
icon = icon .. ' '
end
return icon .. name .. " " .. context.tabnr
end
M.tab_component = {
"tabs",
max_length = vim.o.columns,
mode = 1,
fmt = fmt
}
return M
|