akinsho / akinsho/bufferline.nvim

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

Aperta
#976 2 commenti 1 reazione 0 assegnatari Vedi su GitHub
bug
Lingua principale
Lua
Stelle
4.4k
Fork
240
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.