Skip to content

Commit

Permalink
feat(tabpages): pass the bufnr to the name_formatter (#941)
Browse files Browse the repository at this point in the history
  • Loading branch information
ofseed authored Jul 18, 2024
1 parent 2e3c8cc commit 28e347d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion doc/bufferline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ The available configuration are:
name_formatter = function(buf) -- buf contains:
-- name | str | the basename of the active file
-- path | str | the full path of the active file
-- bufnr (buffer only) | int | the number of the active buffer
-- bufnr | int | the number of the active buffer
-- buffers (tabs only) | table(int) | the numbers of the buffers in the tab
-- tabnr (tabs only) | int | the "handle" of the tab, can be converted to its ordinal number using: `vim.api.nvim_tabpage_get_number(buf.tabnr)`
end,
Expand Down
1 change: 1 addition & 0 deletions lua/bufferline/models.lua
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ function Tabpage:new(tab)
tab.name = tab.name_formatter({
name = tab.name,
path = tab.path,
bufnr = tab.buf,
tabnr = tab.id,
buffers = tab.buffers,
}) or tab.name
Expand Down

0 comments on commit 28e347d

Please sign in to comment.