mirror of
https://github.com/neovim/neovim.git
synced 2026-09-02 12:23:50 +00:00
Problem: If an autocommand handler focuses the tab page we're closing during a `:tabonly` (with some conditions), we hit an assert failure in `win_close_othertab()`. For this to occur, we need: - `nvim_buf_delete()` to trigger `close_windows()` (as is done in `cmdwin.lua`'s `_cleanup()`) - `close_windows()` then calls `win_close_othertab()`, removing the window (`win_free_mem()`) - then in the caller, `tabpage_close_other()`, the loop continues (we don't detect `tp_lastwin == wp` since we've unlinked the window) - the loop assumes that `curtab != tp` but we've refocused `curtab` so the `ex_win_close()` call passes `tp` as `curtab`, causing the assert to fail Solution: Detect the focus of `curtab` and abort closing the tab.