To: vim_dev@googlegroups.com Subject: Patch 8.2.4706 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.4706 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) Files: src/window.c, src/testdir/test_autocmd.vim *** ../vim-8.2.4705/src/window.c 2022-04-06 17:59:18.062549102 +0100 --- src/window.c 2022-04-07 14:03:58.606375748 +0100 *************** *** 2814,2820 **** if (win->w_buffer != NULL) // Close the link to the buffer. close_buffer(win, win->w_buffer, free_buf ? DOBUF_UNLOAD : 0, ! FALSE, FALSE); // Careful: Autocommands may have closed the tab page or made it the // current tab page. --- 2814,2820 ---- if (win->w_buffer != NULL) // Close the link to the buffer. close_buffer(win, win->w_buffer, free_buf ? DOBUF_UNLOAD : 0, ! FALSE, TRUE); // Careful: Autocommands may have closed the tab page or made it the // current tab page. *** ../vim-8.2.4705/src/testdir/test_autocmd.vim 2022-04-06 17:59:18.062549102 +0100 --- src/testdir/test_autocmd.vim 2022-04-07 14:03:58.606375748 +0100 *************** *** 365,370 **** --- 365,387 ---- 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' *** ../vim-8.2.4705/src/version.c 2022-04-07 13:58:00.927085100 +0100 --- src/version.c 2022-04-07 14:07:45.773943754 +0100 *************** *** 748,749 **** --- 748,751 ---- { /* Add new patch number below this line */ + /**/ + 4706, /**/ -- "I love deadlines. I especially like the whooshing sound they make as they go flying by." -- Douglas Adams /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///