mirror of
https://github.com/neovim/neovim.git
synced 2026-05-05 13:35:02 +00:00
Problem: TabClosed is fired after close_buffer is called (after b_nwindows is decremented) and after the tab page is removed from the list, but before it's freed. This causes inconsistencies such as the removed tabpage having a valid handle and functions like nvim_tabpage_get_number returning nonsense. Solution: fire it after free_tabpage. Try to maintain the Nvim-specific behaviour of setting `<amatch>` to the old tab page number, and the (undocumented) behaviour of setting `<abuf>` to the buffer it was showing (close_buffer sets w_buffer to NULL if it was freed, so it should be OK pass it to apply_autocmds_group, similar to before).