Merge pull request #1197 from chrisbra/eclim

Cache eclim errorlist
This commit is contained in:
Christian Brabandt 2016-07-04 20:29:08 +02:00 committed by GitHub
commit 4d0c4f6b1e

View File

@ -16,7 +16,13 @@ function! airline#extensions#eclim#creat_line(...)
endfunction
function! airline#extensions#eclim#get_warnings()
" Cache vavlues, so that it isn't called too often
if exists("s:eclim_errors") &&
\ get(b:, 'airline_changenr', 0) == changenr()
return s:eclim_errors
endif
let eclimList = eclim#display#signs#GetExisting()
let s:eclim_errors = ''
if !empty(eclimList)
" Remove any non-eclim signs (see eclim#display#signs#Update)
@ -39,11 +45,12 @@ function! airline#extensions#eclim#get_warnings()
let errorsNumber = len(eclimList)
let errors = "[Eclim:" . type . " line:".string(errorsLine)." (".string(errorsNumber).")]"
if !exists(':SyntasticCheck') || SyntasticStatuslineFlag() == ''
return errors.(g:airline_symbols.space)
let s:eclim_errors = errors.(g:airline_symbols.space)
endif
endif
endif
return ''
let b:airline_changenr = changenr()
return s:eclim_errors
endfunction
function! airline#extensions#eclim#init(ext)