patch 8.2.4706: buffer remains active with WinClosed and tabpages
Problem: Buffer remains active if a WinClosed event throws an exception
when there are multiple tabpages.
Solution: Ignore aborting() when closing the buffer. (closes #10101)
diff --git a/src/testdir/test_autocmd.vim b/src/testdir/test_autocmd.vim
index 89023a1..eb1fa04 100644
--- a/src/testdir/test_autocmd.vim
+++ b/src/testdir/test_autocmd.vim
Binary files differ
diff --git a/src/version.c b/src/version.c
index 6262361..d0205d7 100644
--- a/src/version.c
+++ b/src/version.c
@@ -747,6 +747,8 @@
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 4706,
+/**/
4705,
/**/
4704,
diff --git a/src/window.c b/src/window.c
index 8ec4823..f763475 100644
--- a/src/window.c
+++ b/src/window.c
@@ -2814,7 +2814,7 @@
if (win->w_buffer != NULL)
// Close the link to the buffer.
close_buffer(win, win->w_buffer, free_buf ? DOBUF_UNLOAD : 0,
- FALSE, FALSE);
+ FALSE, TRUE);
// Careful: Autocommands may have closed the tab page or made it the
// current tab page.