Add a check to make tests fail less

This commit is contained in:
w0rp 2017-05-18 09:27:18 +01:00
parent c41afa2b0d
commit 3ca70cb841

View File

@ -26,6 +26,11 @@ function! ale#history#Add(buffer, status, job_id, command) abort
endfunction endfunction
function! s:FindHistoryItem(buffer, job_id) abort function! s:FindHistoryItem(buffer, job_id) abort
" Stop immediately if there's nothing set up for the buffer.
if !has_key(g:ale_buffer_info, a:buffer)
return {}
endif
" Search backwards to find a matching job ID. IDs might be recycled, " Search backwards to find a matching job ID. IDs might be recycled,
" so finding the last one should be good enough. " so finding the last one should be good enough.
for l:obj in reverse(g:ale_buffer_info[a:buffer].history[:]) for l:obj in reverse(g:ale_buffer_info[a:buffer].history[:])