From 3ca70cb841aa352eef56545e72188d0420cfa3f2 Mon Sep 17 00:00:00 2001 From: w0rp Date: Thu, 18 May 2017 09:27:18 +0100 Subject: Add a check to make tests fail less --- autoload/ale/history.vim | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/autoload/ale/history.vim b/autoload/ale/history.vim index 78703be1..0356c022 100644 --- a/autoload/ale/history.vim +++ b/autoload/ale/history.vim @@ -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[:]) -- cgit v1.2.3