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)
augroup! test-WinClosed
endfunc
+func Test_WinClosed_throws_with_tabs()
+ tabnew
+ let bnr = bufnr()
+ call assert_equal(1, bufloaded(bnr))
+ augroup test-WinClosed
+ autocmd WinClosed * throw 'foo'
+ augroup END
+ try
+ close
+ catch /.*/
+ endtry
+ call assert_equal(0, bufloaded(bnr))
+
+ autocmd! test-WinClosed
+ augroup! test-WinClosed
+endfunc
+
func s:AddAnAutocmd()
augroup vimBarTest
au BufReadCmd * echo 'hello'
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 4706,
/**/
4705,
/**/
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.