Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
1 task done
rod-stuchi opened this issue Oct 31, 2024 · 0 comments
Open
1 task done
Labels
bug Something isn't working

Comments

@rod-stuchi
Copy link

rod-stuchi commented Oct 31, 2024

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

I have numbers set to show ordinal number.

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.

2024-10-31_16-13-49.mp4

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

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

@rod-stuchi rod-stuchi added the bug Something isn't working label Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant