aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/nvim/fileio.c2
-rw-r--r--src/nvim/testdir/test_autocmd.vim10
-rw-r--r--src/nvim/version.c2
3 files changed, 10 insertions, 4 deletions
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c
index dbe4a144df..e10f7fd2a2 100644
--- a/src/nvim/fileio.c
+++ b/src/nvim/fileio.c
@@ -5581,6 +5581,8 @@ static void au_del_group(char_u *name)
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;
AutoPat *ap;
diff --git a/src/nvim/testdir/test_autocmd.vim b/src/nvim/testdir/test_autocmd.vim
index 7d786c88cf..f05a55f1aa 100644
--- a/src/nvim/testdir/test_autocmd.vim
+++ b/src/nvim/testdir/test_autocmd.vim
@@ -182,13 +182,17 @@ func Test_augroup_warning()
doautocmd VimEnter
redir END
call assert_true(match(res, "W19:") < 0)
+ au! VimEnter
endfunc
func Test_augroup_deleted()
- " This caused a crash
+ " This caused a crash before E936 was introduced
augroup x
+ call assert_fails('augroup! x', 'E936:')
+ au VimEnter * echo
+ augroup end
augroup! x
- au VimEnter * echo
- au VimEnter
+ call assert_true(match(execute('au VimEnter'), "-Deleted-.*VimEnter") >= 0)
+ au! VimEnter
endfunc
diff --git a/src/nvim/version.c b/src/nvim/version.c
index 2d5f2437de..f34473098c 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -126,7 +126,7 @@ static int included_patches[] = {
// 2317,
// 2316 NA
// 2315,
- // 2314,
+ 2314,
2313,
2312,
// 2311 NA