mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:7.4.2300
Problem: Get warning for deleting autocommand group when the autocommand
using the group is scheduled for deletion. (Pavol Juhas)
Solution: Check for deleted autocommand.
5c80908ced
This commit is contained in:
parent
7486e7586d
commit
6f285226a9
@ -5580,7 +5580,7 @@ static void au_del_group(char_u *name)
|
|||||||
for (event = (event_T)0; (int)event < (int)NUM_EVENTS;
|
for (event = (event_T)0; (int)event < (int)NUM_EVENTS;
|
||||||
event = (event_T)((int)event + 1)) {
|
event = (event_T)((int)event + 1)) {
|
||||||
for (ap = first_autopat[(int)event]; ap != NULL; ap = ap->next) {
|
for (ap = first_autopat[(int)event]; ap != NULL; ap = ap->next) {
|
||||||
if (ap->group == i) {
|
if (ap->group == i && ap->pat != NULL) {
|
||||||
give_warning((char_u *)
|
give_warning((char_u *)
|
||||||
_("W19: Deleting augroup that is still in use"), true);
|
_("W19: Deleting augroup that is still in use"), true);
|
||||||
in_use = true;
|
in_use = true;
|
||||||
|
@ -152,6 +152,11 @@ func Test_early_bar()
|
|||||||
call assert_equal(1, len(split(execute('au vimBarTest'), "\n")))
|
call assert_equal(1, len(split(execute('au vimBarTest'), "\n")))
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func RemoveGroup()
|
||||||
|
autocmd! StartOK
|
||||||
|
augroup! StartOK
|
||||||
|
endfunc
|
||||||
|
|
||||||
func Test_augroup_warning()
|
func Test_augroup_warning()
|
||||||
augroup TheWarning
|
augroup TheWarning
|
||||||
au VimEnter * echo 'entering'
|
au VimEnter * echo 'entering'
|
||||||
@ -167,4 +172,14 @@ func Test_augroup_warning()
|
|||||||
augroup Another
|
augroup Another
|
||||||
augroup END
|
augroup END
|
||||||
call assert_true(match(execute('au VimEnter'), "-Deleted-.*VimEnter") >= 0)
|
call assert_true(match(execute('au VimEnter'), "-Deleted-.*VimEnter") >= 0)
|
||||||
|
|
||||||
|
" no warning for postpone aucmd delete
|
||||||
|
augroup StartOK
|
||||||
|
au VimEnter * call RemoveGroup()
|
||||||
|
augroup END
|
||||||
|
call assert_true(match(execute('au VimEnter'), "StartOK.*VimEnter") >= 0)
|
||||||
|
redir => res
|
||||||
|
doautocmd VimEnter
|
||||||
|
redir END
|
||||||
|
call assert_true(match(res, "W19:") < 0)
|
||||||
endfunc
|
endfunc
|
||||||
|
@ -140,7 +140,7 @@ static int included_patches[] = {
|
|||||||
// 2303,
|
// 2303,
|
||||||
// 2302 NA
|
// 2302 NA
|
||||||
// 2301 NA
|
// 2301 NA
|
||||||
// 2300,
|
2300,
|
||||||
// 2299,
|
// 2299,
|
||||||
// 2298 NA
|
// 2298 NA
|
||||||
// 2297 NA
|
// 2297 NA
|
||||||
|
Loading…
Reference in New Issue
Block a user