#107 Stop jobs when buffers close

This commit is contained in:
w0rp
2016-10-23 22:41:00 +01:00
parent 36461b69d7
commit 7481facd73
9 changed files with 161 additions and 86 deletions

View File

@@ -2,19 +2,16 @@
" Description: Utility functions related to cleaning state.
function! ale#cleanup#Buffer(buffer) abort
if has_key(g:ale_buffer_count_map, a:buffer)
call remove(g:ale_buffer_count_map, a:buffer)
endif
if has_key(g:ale_buffer_loclist_map, a:buffer)
call remove(g:ale_buffer_loclist_map, a:buffer)
endif
if has_key(g:ale_buffer_should_reset_map, a:buffer)
call remove(g:ale_buffer_should_reset_map, a:buffer)
endif
if has_key(g:ale_buffer_info, a:buffer)
" When buffers are removed, clear all of the jobs.
for l:job in get(g:ale_buffer_info[a:buffer], 'job_list', [])
call ale#engine#ClearJob(l:job)
endfor
if has_key(g:ale_buffer_sign_dummy_map, a:buffer)
call remove(g:ale_buffer_sign_dummy_map, a:buffer)
call remove(g:ale_buffer_info, a:buffer)
endif
endfunction