Merge pull request #618 from rkannan82/master
Display warnings only when there are no errors messages.
This commit is contained in:
commit
64b9ae176d
@ -20,12 +20,24 @@ function! airline#extensions#eclim#get_warnings()
|
||||
|
||||
if !empty(eclimList)
|
||||
" Remove any non-eclim signs (see eclim#display#signs#Update)
|
||||
call filter(eclimList, 'v:val.name =~ "^\\(qf_\\)\\?\\(error\\|info\\|warning\\)$"')
|
||||
" First check for just errors since they are more important.
|
||||
" If there are no errors, then check for warnings.
|
||||
let errorList = filter(copy(eclimList), 'v:val.name =~ "^\\(qf_\\)\\?\\(error\\)$"')
|
||||
|
||||
if (empty(errorList))
|
||||
" use the warnings
|
||||
call filter(eclimList, 'v:val.name =~ "^\\(qf_\\)\\?\\(info\\|warning\\)$"')
|
||||
let type = 'W'
|
||||
else
|
||||
" Use the errors
|
||||
let eclimList = errorList
|
||||
let type = 'E'
|
||||
endif
|
||||
|
||||
if !empty(eclimList)
|
||||
let errorsLine = eclimList[0]['line']
|
||||
let errorsNumber = len(eclimList)
|
||||
let errors = "[Eclim: line:".string(errorsLine)." (".string(errorsNumber).")]"
|
||||
let errors = "[Eclim:" . type . " line:".string(errorsLine)." (".string(errorsNumber).")]"
|
||||
if !exists(':SyntasticCheck') || SyntasticStatuslineFlag() == ''
|
||||
return errors.(g:airline_symbols.space)
|
||||
endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user