akinsho / akinsho/bufferline.nvim

[Bug]: When using sort_by 'insert_after_current' buffer ordinal number are no updated

Đang mở
#976 2 bình luận 1 reaction 0 người được giao Xem trên GitHub
bug
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ả

### Is there an existing issue for this?

- [X] I have searched the existing issues

### What happened?

I have numbers set to show ordinal number.

```lua
numbers = function(opts)
return string.format("%s", opts.lower(opts.ordinal))
end,
```

and set `sort_by` to `insert_after_current`

In this video, when a move to ordinal `1`, and open `init.lua`, buffer `init.lua` has ordinal `2` but it's showing `3`.

https://github.com/user-attachments/assets/71caf822-bce7-4a14-be24-1aa07144cacb

you can see when I go to ordinal `2` it goes to the right buffer, but the ordinal number is not refreshing.

lua require("bufferline").go_to_buffer(2, true)

### What did you expect to happen?

Expected behaviour should be refresh the ordinal number

### Config

```lua
return {
"akinsho/bufferline.nvim",
branch = "main",
dependencies = "nvim-tree/nvim-web-devicons",
init = function()
require("bufferline").setup({
options = {
mode = "buffers",
themable = true,
numbers = function(opts)
return string.format("%s", opts.lower(opts.ordinal))
end,
sort_by = 'insert_after_current',
},
})
end,
}

```

### Additional Information

...

### commit

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