mirror of
https://github.com/vim/vim.git
synced 2025-10-24 08:54:47 -04:00
patch 9.1.1393: missing test for switching buffers and reusing curbuf
Problem: The check in buf_freeall that restores curwin subtly prevents
leaving an unloaded buffer in a window when reusing curbuf, if
autocommands switch to a different buffer.
Solution: Add a test case that covers this. Also ensure splitting isn't
possible, as that could do the same (Sean Dewar)
closes: #17325
Signed-off-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
c49cb93a86
commit
31be82e66d
@@ -909,7 +909,7 @@ buf_freeall(buf_T *buf, int flags)
|
||||
// If the buffer was in curwin and the window has changed, go back to that
|
||||
// window, if it still exists. This avoids that ":edit x" triggering a
|
||||
// "tabnext" BufUnload autocmd leaves a window behind without a buffer.
|
||||
if (is_curwin && curwin != the_curwin && win_valid_any_tab(the_curwin))
|
||||
if (is_curwin && curwin != the_curwin && win_valid_any_tab(the_curwin))
|
||||
{
|
||||
block_autocmds();
|
||||
goto_tabpage_win(the_curtab, the_curwin);
|
||||
|
||||
Reference in New Issue
Block a user