eclim: only consider signs placed by eclim

Ref: https://github.com/bling/vim-airline/pull/293
This commit is contained in:
Daniel Hahler 2013-12-04 08:58:30 +01:00
parent 87951ba090
commit ba899b2dde
1 changed files with 11 additions and 5 deletions

View File

@ -17,12 +17,18 @@ endfunction
function! airline#extensions#eclim#get_warnings()
let eclimList = eclim#display#signs#GetExisting()
if !empty(eclimList)
let errorsLine = eclimList[0]['line']
let errorsNumber = len(eclimList)
let errors = "[Eclim: line:".string(errorsLine)." (".string(errorsNumber).")]"
if !exists(':SyntasticCheck') || SyntasticStatuslineFlag() == ''
return errors.(g:airline_symbols.space)
" Remove any non-eclim signs (see eclim#display#signs#Update)
call filter(eclimList, "v:val.name =~ '^\(qf_\)\?\(error\|info\|warning\)$'")
if !empty(eclimList)
let errorsLine = eclimList[0]['line']
let errorsNumber = len(eclimList)
let errors = "[Eclim: line:".string(errorsLine)." (".string(errorsNumber).")]"
if !exists(':SyntasticCheck') || SyntasticStatuslineFlag() == ''
return errors.(g:airline_symbols.space)
endif
endif
endif
return ''