BufLeave

The BufLeave event:

Fires:

radio_button_unchecked

Before leaving to another buffer.

radio_button_unchecked

When leaving or closing the current window and the new current window does not contain the same buffer.

Notes:

radio_button_unchecked

Does not fire when exiting Neovim with :qa or :q.