Closed astier closed 5 years ago
What happens when you manually emulate Bbye? That is, use :enew
, set a few "hidden" flags (as per https://github.com/moll/vim-bbye/blob/master/plugin/bbye.vim#L66) and then :bdelete
the previous last open buffer? I don't have the ability to test it with Bufferline atm, but I can hopefully help you try debugging it.
It seems to have something to do with setl nobuflisted.
It can be observed that buffer 1 and the respective filename are still shown in the bufferlist along with the empty buffer. The buffer is however indeed deleted because it is not possible to switch back via :bn 1 and nvim throws an error if I try it as you can see it in the screenshot. The same result occurs when I also include the other steps from the link you have send me. However, only :setl nobuflisted causes it. If i leave it out it works as expected.
Note that if I use :Bd directly only one buffer is shown in the bufferline with the name of the deleted buffer instead of two buffers (old and new).
Well done on pinpointing the problem. I think this hints toward it being Bufferline's anomaly rather than Bbye's, given Bufferline should update its list of open buffers properly in the presence of unlisted ones.
Agree. Probably its caused by bufferline. Unfortunately it sees like the project-owner does not maintain it anymore.
I don't think it was a very large project, so with your insight above, you may be able to fix it yourself. I've been using https://github.com/ap/vim-buftabline for a few years myself. You're welcome to ditch Bufferline and pick that one. Makes more sense IMO to have a single wide bar at the top that jam open files to the constrained space that is a single file footer. Especially if you have two files open side by side — the workflow Bbye.vim fixes. Although Buftabline's README states Airline, the plugin you're using to drive Bufferline, already supports showing buffers separately...
I just figured out that airline ships already with its own built-in extension called tabline and I switched to it. Works very good with bbye and definitely better than bufferline. Also has mouse-support and is very configurable. Thank you for your help :)
The bufferline-plugin shows in the airline-statusline the opened buffers. However, when I delete the last buffer via :Bdelete or :Bwipeout then bufferline still shows the name of the deleted buffer as if it still would be open. If I open another file it correctly replaces the name of the deleted buffer with the new buffer.
My assumption is that the bbye-plugin sets something wrong because bufferline works correctly if I delete the last buffer via :bdelete.