akinsho / akinsho/bufferline.nvim

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

Ouverte
#987 2 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
enhancement
Langage dominant
Lua
Étoiles
4.4k
Forks
240
Métriques de merge des PR
Aucune PR mergée en 30 j

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_

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.