summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-05-18 09:27:18 +0100
committerw0rp <devw0rp@gmail.com>2017-05-18 09:27:18 +0100
commit3ca70cb841aa352eef56545e72188d0420cfa3f2 (patch)
tree71ab000be2b9817bfe7b3a233a691998fbd7746b
parentc41afa2b0dd3ca44d6c40bd31af11c70bebed97a (diff)
downloadale-3ca70cb841aa352eef56545e72188d0420cfa3f2.zip
Add a check to make tests fail less
-rw-r--r--autoload/ale/history.vim5
1 files changed, 5 insertions, 0 deletions
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[:])