mirror of
https://github.com/neovim/neovim.git
synced 2025-12-22 14:18:56 +00:00
Avoid `prevwin == curwin` when closing `curwin`
Problem: When closing the current window (or when moving it to a tabpage), the
previous window may refer to the new current window
(`winnr() == winnr('#')`) if that window is selected as the
new current window.
Solution: Set `prevwin = NULL` when switching away from an invalid `curwin` and
the target window was the `prevwin`.
(Sean Dewar)
related: vim/vim#4537
closes: vim/vim#13762
bf44b69d1f
Co-authored-by: Sean Dewar <seandewar@users.noreply.github.com>