Avoid calling ALE cleanup code if ALE never tried to check a buffer

This commit is contained in:
w0rp 2018-06-19 20:12:33 +01:00
parent b8a1038a41
commit e306e5cdb0
No known key found for this signature in database
GPG Key ID: 0FC1ECAA8C81CD83
2 changed files with 2 additions and 2 deletions

View File

@ -228,7 +228,7 @@ call ale#autocmd#InitAuGroups()
augroup ALECleanupGroup
autocmd!
" Clean up buffers automatically when they are unloaded.
autocmd BufDelete * call ale#engine#Cleanup(str2nr(expand('<abuf>')))
autocmd BufDelete * if exists('*ale#engine#Cleanup') | call ale#engine#Cleanup(str2nr(expand('<abuf>'))) | endif
autocmd QuitPre * call ale#events#QuitEvent(str2nr(expand('<abuf>')))
augroup END

View File

@ -191,7 +191,7 @@ Execute (g:ale_echo_cursor = 1 should bind cursor events):
Execute (ALECleanupGroup should include the right commands):
AssertEqual [
\ 'BufDelete * call ale#engine#Cleanup(str2nr(expand(''<abuf>'')))',
\ 'BufDelete * if exists(''*ale#engine#Cleanup'') | call ale#engine#Cleanup(str2nr(expand(''<abuf>''))) | endif',
\ 'QuitPre * call ale#events#QuitEvent(str2nr(expand(''<abuf>'')))',
\], CheckAutocmd('ALECleanupGroup')