akinsho / akinsho/bufferline.nvim

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

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

描述

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

贡献指南

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

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

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