To: vim_dev@googlegroups.com Subject: Patch 7.4.2314 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 7.4.2314 Problem: No error when deleting an augroup while it's the current one. Solution: Disallow deleting an augroup when it's the current one. Files: src/fileio.c, src/testdir/test_autocmd.vim *** ../vim-7.4.2313/src/fileio.c 2016-09-03 16:43:49.147060493 +0200 --- src/fileio.c 2016-09-03 16:58:56.619118153 +0200 *************** *** 8017,8022 **** --- 8017,8024 ---- i = au_find_group(name); if (i == AUGROUP_ERROR) /* the group doesn't exist */ EMSG2(_("E367: No such group: \"%s\""), name); + else if (i == current_augroup) + EMSG(_("E936: Cannot delete the current group")); else { event_T event; *** ../vim-7.4.2313/src/testdir/test_autocmd.vim 2016-09-03 16:43:49.147060493 +0200 --- src/testdir/test_autocmd.vim 2016-09-03 16:51:19.859125261 +0200 *************** *** 182,194 **** doautocmd VimEnter redir END call assert_true(match(res, "W19:") < 0) endfunc func Test_augroup_deleted() ! " This caused a crash augroup x augroup! x ! au VimEnter * echo ! au VimEnter endfunc --- 182,198 ---- doautocmd VimEnter redir END call assert_true(match(res, "W19:") < 0) + au! VimEnter endfunc func Test_augroup_deleted() ! " This caused a crash before E936 was introduced augroup x + call assert_fails('augroup! x', 'E936:') + au VimEnter * echo + augroup end augroup! x ! call assert_true(match(execute('au VimEnter'), "-Deleted-.*VimEnter") >= 0) ! au! VimEnter endfunc *** ../vim-7.4.2313/src/version.c 2016-09-03 16:43:49.147060493 +0200 --- src/version.c 2016-09-03 16:57:59.723638721 +0200 *************** *** 765,766 **** --- 765,768 ---- { /* Add new patch number below this line */ + /**/ + 2314, /**/ -- We are the Borg of GNU GPL. We will assimilate your source code. Resistance is futile. /// 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 ///