diff options
author | w0rp <devw0rp@gmail.com> | 2017-08-13 22:27:01 +0100 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2017-08-13 22:27:01 +0100 |
commit | 79701f6f200489d0eef2ea6e91f7e46be012cdd3 (patch) | |
tree | 99e3b95b01e62ab2faafd30b30a2bd29c53d43d9 /plugin | |
parent | 2d02de33d4ac8b90437b13467956530b8df32bf1 (diff) | |
download | ale-79701f6f200489d0eef2ea6e91f7e46be012cdd3.zip |
#653 Skip filetype keys in g:ale_buffer_info during cleanup
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/ale.vim | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/plugin/ale.vim b/plugin/ale.vim index f98e6949..e2180129 100644 --- a/plugin/ale.vim +++ b/plugin/ale.vim @@ -296,12 +296,17 @@ function! s:ALEToggle() abort call ale#balloon#Enable() endif else - " Make sure the buffer number is a number, not a string, - " otherwise things can go wrong. - for l:buffer in map(keys(g:ale_buffer_info), 'str2nr(v:val)') - " 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) + 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 " Remove highlights for the current buffer now. |