From cbf0568061b5d30af3478ca5db3bb73bd97c9981 Mon Sep 17 00:00:00 2001 From: Felipe Sere Date: Mon, 17 Sep 2018 15:50:04 +0100 Subject: Join the ALECleanupGroup and ensure we don't run cleanup if ale.vim isn't loaded --- plugin/ale.vim | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'plugin') diff --git a/plugin/ale.vim b/plugin/ale.vim index 46b3bba6..a49ea039 100644 --- a/plugin/ale.vim +++ b/plugin/ale.vim @@ -217,9 +217,8 @@ augroup ALECleanupGroup " Clean up buffers automatically when they are unloaded. autocmd BufDelete * if exists('*ale#engine#Cleanup') | call ale#engine#Cleanup(str2nr(expand(''))) | endif autocmd QuitPre * call ale#events#QuitEvent(str2nr(expand(''))) -augroup END - -if exists('##VimSuspend') - autocmd VimSuspend * call ale#engine#CleanupEveryBuffer() -end + if exists('##VimSuspend') + autocmd VimSuspend * if exists('*ale#engine#CleanupEveryBuffer') | call ale#engine#CleanupEveryBuffer() | endif + endif +augroup END -- cgit v1.2.3