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
1 changed files with 5 additions and 0 deletions

View File

@ -26,6 +26,11 @@ function! ale#history#Add(buffer, status, job_id, command) abort
endfunction
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,
" so finding the last one should be good enough.
for l:obj in reverse(g:ale_buffer_info[a:buffer].history[:])