akinsho / akinsho/bufferline.nvim

[Feature Request]: set opts.numbers to show the same number of the go_to(bufnr)

Open
#987 2 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Lua
Stars
4.4k
Forks
240
PR merge metrics
No merged PRs in 30d

Description

### What?

I'm trying to customize the numbers in opts, as described [here](https://github.com/akinsho/bufferline.nvim/blob/9f0826ae6adfd836a23bf8a4910e3c07450211f4/doc/bufferline.txt#L267), I want to combine this number with the `go_to()` function, so that it can show the buffer number to go to.

I found that the parameter of `go_to()` is the index in `state.components()` or `state.visible_components()`, based on the parameter `absolute`. So I'm trying to get the index of buffer in numbers functions, but I'm unable to get it to work. Here is what I'm trying to modify:

```lua
numbers = function(opts)
local state = require("bufferline.state")
local list = state.visible_components
for buf in list do
-- there is a name filed in buf, but I cannot find the buffer title in opts
if buf.name == opts.name then
return string.format('%s', buf.id)
end
end
end

```

### Why?

_No response_

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.