diff options
author | Felipe Sere <felipesere@gmail.com> | 2018-09-16 15:57:13 +0100 |
---|---|---|
committer | Felipe Sere <felipesere@gmail.com> | 2018-09-16 15:57:13 +0100 |
commit | fba4cfeae91e6cdb0c1079f7a3807ac328d35087 (patch) | |
tree | a4c704127f0a335514f62ae7673ba780c97ce37a /autoload | |
parent | 0948dcc435201f0ea62a22c53ce31971a75cba35 (diff) | |
download | ale-fba4cfeae91e6cdb0c1079f7a3807ac328d35087.zip |
To avoid blocking build tools, suspend ALE when suspending vim
Diffstat (limited to 'autoload')
-rw-r--r-- | autoload/ale/engine.vim | 16 | ||||
-rw-r--r-- | autoload/ale/toggle.vim | 19 |
2 files changed, 18 insertions, 17 deletions
diff --git a/autoload/ale/engine.vim b/autoload/ale/engine.vim index b6c2d3c9..05db0e49 100644 --- a/autoload/ale/engine.vim +++ b/autoload/ale/engine.vim @@ -18,6 +18,22 @@ if !has_key(s:, 'executable_cache_map') let s:executable_cache_map = {} endif + +function! ale#engine#CleanupEveryBuffer() abort + for l:key in keys(g:ale_buffer_info) + " The key could be a filename or a buffer number, so try and + " convert it to a number. We need a number for the other + " functions. + let l:buffer = str2nr(l:key) + + if l:buffer > 0 + " Stop all jobs and clear the results for everything, and delete + " all of the data we stored for the buffer. + call ale#engine#Cleanup(l:buffer) + endif + endfor +endfunction + function! ale#engine#ResetExecutableCache() abort let s:executable_cache_map = {} endfunction diff --git a/autoload/ale/toggle.vim b/autoload/ale/toggle.vim index 1d052b4f..8e642b3f 100644 --- a/autoload/ale/toggle.vim +++ b/autoload/ale/toggle.vim @@ -15,21 +15,6 @@ function! s:DisablePostamble() abort endif endfunction -function! s:CleanupEveryBuffer() abort - for l:key in keys(g:ale_buffer_info) - " The key could be a filename or a buffer number, so try and - " convert it to a number. We need a number for the other - " functions. - let l:buffer = str2nr(l:key) - - if l:buffer > 0 - " Stop all jobs and clear the results for everything, and delete - " all of the data we stored for the buffer. - call ale#engine#Cleanup(l:buffer) - endif - endfor -endfunction - function! ale#toggle#Toggle() abort let g:ale_enabled = !get(g:, 'ale_enabled') @@ -40,7 +25,7 @@ function! ale#toggle#Toggle() abort call ale#balloon#Enable() endif else - call s:CleanupEveryBuffer() + call ale#engine#CleanupEveryBuffer() call s:DisablePostamble() if exists('*ale#balloon#Disable') @@ -64,7 +49,7 @@ function! ale#toggle#Disable() abort endfunction function! ale#toggle#Reset() abort - call s:CleanupEveryBuffer() + call ale#engine#CleanupEveryBuffer() call ale#highlight#UpdateHighlights() endfunction |