From e306e5cdb06ede621de529849e54f11f0e8069fe Mon Sep 17 00:00:00 2001 From: w0rp Date: Tue, 19 Jun 2018 20:12:33 +0100 Subject: Avoid calling ALE cleanup code if ALE never tried to check a buffer --- plugin/ale.vim | 2 +- test/test_autocmd_commands.vader | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin/ale.vim b/plugin/ale.vim index bea5a49e..d9f1216e 100644 --- a/plugin/ale.vim +++ b/plugin/ale.vim @@ -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(''))) + autocmd BufDelete * if exists('*ale#engine#Cleanup') | call ale#engine#Cleanup(str2nr(expand(''))) | endif autocmd QuitPre * call ale#events#QuitEvent(str2nr(expand(''))) augroup END diff --git a/test/test_autocmd_commands.vader b/test/test_autocmd_commands.vader index b02f852c..63e704bd 100644 --- a/test/test_autocmd_commands.vader +++ b/test/test_autocmd_commands.vader @@ -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('''')))', + \ 'BufDelete * if exists(''*ale#engine#Cleanup'') | call ale#engine#Cleanup(str2nr(expand(''''))) | endif', \ 'QuitPre * call ale#events#QuitEvent(str2nr(expand('''')))', \], CheckAutocmd('ALECleanupGroup') -- cgit v1.2.3