fixup: tabs component doesn't show fugitive status name properly

fixes #900
This commit is contained in:
shadmansaleh 2022-11-26 09:58:47 +06:00
parent 3325d5d43a
commit b6314ac556
1 changed files with 3 additions and 1 deletions

View File

@ -31,7 +31,9 @@ function Tab:label()
local bufnr = buflist[winnr] local bufnr = buflist[winnr]
local file = modules.utils.stl_escape(vim.api.nvim_buf_get_name(bufnr)) local file = modules.utils.stl_escape(vim.api.nvim_buf_get_name(bufnr))
local buftype = vim.fn.getbufvar(bufnr, '&buftype') local buftype = vim.fn.getbufvar(bufnr, '&buftype')
if buftype == 'help' then if vim.bo.filetype == 'fugitive' then
return 'fugitive: ' .. vim.fn.fnamemodify(file, ':h:h:t')
elseif buftype == 'help' then
return 'help:' .. vim.fn.fnamemodify(file, ':t:r') return 'help:' .. vim.fn.fnamemodify(file, ':t:r')
elseif buftype == 'terminal' then elseif buftype == 'terminal' then
local match = string.match(vim.split(file, ' ')[1], 'term:.*:(%a+)') local match = string.match(vim.split(file, ' ')[1], 'term:.*:(%a+)')