akinsho / akinsho/bufferline.nvim

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

未关闭
#987 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
enhancement
主要语言
Lua
星标
4.4k
派生
240
PR 合并指标
30 天内没有已合并 PR

描述

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

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。