To: vim_dev@googlegroups.com Subject: Patch 8.1.0060 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.1.0060 Problem: Crash when autocommands delete the current buffer. (Dominique Pelle) Solution: Check that autocommands don't change the buffer. Files: src/quickfix.c, src/testdir/test_quickfix.vim *** ../vim-8.1.0059/src/quickfix.c 2018-05-21 16:56:33.683217200 +0200 --- src/quickfix.c 2018-06-16 21:57:15.946537874 +0200 *************** *** 6272,6279 **** --- 6272,6287 ---- if (res >= 0) qf_list_changed(qi, qi->qf_curlist); if (au_name != NULL) + { + buf_T *curbuf_old = curbuf; + apply_autocmds(EVENT_QUICKFIXCMDPOST, au_name, curbuf->b_fname, TRUE, curbuf); + if (curbuf != curbuf_old) + // Autocommands changed buffer, don't jump now, "qi" may + // be invalid. + res = 0; + } if (res > 0 && (eap->cmdidx == CMD_cbuffer || eap->cmdidx == CMD_lbuffer)) qf_jump(qi, 0, 0, eap->forceit); /* display first error */ *** ../vim-8.1.0059/src/testdir/test_quickfix.vim 2018-05-15 21:53:11.000000000 +0200 --- src/testdir/test_quickfix.vim 2018-06-16 21:49:48.980572266 +0200 *************** *** 3350,3352 **** --- 3350,3364 ---- call assert_equal('Errors', w:quickfix_title) cclose endfunc + + func Test_lbuffer_with_bwipe() + new + new + augroup nasty + au * * bwipe + augroup END + lbuffer + augroup nasty + au! + augroup END + endfunc *** ../vim-8.1.0059/src/version.c 2018-06-16 17:25:17.997346631 +0200 --- src/version.c 2018-06-16 21:58:12.078265886 +0200 *************** *** 763,764 **** --- 763,766 ---- { /* Add new patch number below this line */ + /**/ + 60, /**/ -- Keyboard not found. Think ENTER to continue. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///