fixup: All tab names have prefix "fugitive: " if current buffer is

fugitive status buffer

fixes #901
This commit is contained in:
shadmansaleh 2022-11-28 20:48:27 +06:00
parent b6314ac556
commit bfa0d99ba6
1 changed files with 1 additions and 1 deletions

View File

@ -31,7 +31,7 @@ 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 vim.bo.filetype == 'fugitive' then if vim.api.nvim_buf_get_option(bufnr, 'filetype') == 'fugitive' then
return 'fugitive: ' .. vim.fn.fnamemodify(file, ':h:h:t') return 'fugitive: ' .. vim.fn.fnamemodify(file, ':h:h:t')
elseif buftype == 'help' then elseif buftype == 'help' then
return 'help:' .. vim.fn.fnamemodify(file, ':t:r') return 'help:' .. vim.fn.fnamemodify(file, ':t:r')