romgrk / barbar.nvim

The neovim tabline plugin.
2.16k stars 81 forks source link

This is a borderline "bug" in how the tabs maintain the buffer sequence #592

Open EdmundsEcho opened 1 week ago

EdmundsEcho commented 1 week ago

First and foremost, Thank you! for this aesthetically pleasing, and productive neovim plugin using lua.

Background

I am a longtime user of vim, then neovim (about 8 years ago now). I give you this context because there is a norm that I clearly have become dependent on in how the buffer sequencing is maintained following deletions and additions of new buffers.

IMO

I might put forward that when a plugin interacts/overlaps with the builtin neovim functionality, that the design should align with it when possible and makes sense.

Case in point

The sequence that barbar presents the tabs is not aligned with the builtin :bn and :bp commands.

A fresh neovim session - all good. However, delete and add new buffers over time, the behavior diverges from a norm. The behavior exists with restored sessions so is difficult to "clear away".

Finally, I do have the <leader>1 ... up and running. Previous generations of plugins with this functionality did so while maintaining the alignment of the tab sequence with the :bp, :bn commands.

Thank you again. I hope this helps!

Iron-E commented 1 week ago

As you've noticed barbar.nvim's buffer order does not reflect that of the internal Vim buffer list. This is so that we can offer features (e.g. reordering buffers) & customization (e.g. insertion position) that aren't possible with the built-in options.

However, we do offer :BufferNext and :BufferPrevious which navigate like :bn & :bp, with the addendum that it works as expected given barbar.nvim's buffer layout. Do these commands address this issue?

EdmundsEcho commented 1 week ago

You have a tough job managing everyone's experience and preference (e.g., I saw a request to order buffers by frequency of use!, no bueno in my book). How about enabling a register (config option) whereby barbar will maintain the sequence to be consistent with :bn and :bp?