akinsho / akinsho/bufferline.nvim

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

Đang mở
#987 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
enhancement
Ngôn ngữ chính
Lua
Star
4.4k
Fork
240
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.