summaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorFelipe Sere <felipesere@gmail.com>2018-09-17 15:50:04 +0100
committerFelipe Sere <felipesere@gmail.com>2018-09-17 15:50:04 +0100
commitcbf0568061b5d30af3478ca5db3bb73bd97c9981 (patch)
tree989924c739281cbbfde95bed645210ec70513cd1 /plugin
parentfba4cfeae91e6cdb0c1079f7a3807ac328d35087 (diff)
downloadale-cbf0568061b5d30af3478ca5db3bb73bd97c9981.zip
Join the ALECleanupGroup and ensure we don't run cleanup if ale.vim isn't loaded
Diffstat (limited to 'plugin')
-rw-r--r--plugin/ale.vim9
1 files changed, 4 insertions, 5 deletions
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('<abuf>'))) | endif
autocmd QuitPre * call ale#events#QuitEvent(str2nr(expand('<abuf>')))
-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