akinsho / akinsho/bufferline.nvim

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

Aperta
#987 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub
enhancement
Lingua principale
Lua
Stelle
4.4k
Fork
240
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

### 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_

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.