romgrk / barbar.nvim

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

fix(bbye): "current buffer" deletion race condition #563

Closed Iron-E closed 3 months ago

Iron-E commented 3 months ago

Closes #550

Currently, attempting to close the "current" buffer repeatedly in a short span of time results in surprising behavior. This is caused by the following two locations in the codebase:

Specifically, the interaction is that the calls to bbye.delete read state.buffers before render.update has had a chance to update it.

The fix here has been to implement an asynchronous, sephamore-like counter which must become available before actions on the "current" buffer can be performed.