Neomake integration: if loclist is empty, fallback to quickfix
This commit is contained in:
parent
61c624ef6c
commit
e79188c3bd
@ -7,14 +7,24 @@ endif
|
||||
let s:error_symbol = get(g:, 'airline#extensions#neomake#error_symbol', 'E:')
|
||||
let s:warning_symbol = get(g:, 'airline#extensions#neomake#warning_symbol', 'W:')
|
||||
|
||||
function! s:get_counts()
|
||||
let l:counts = neomake#statusline#LoclistCounts()
|
||||
|
||||
if empty(l:counts)
|
||||
return neomake#statusline#QflistCounts()
|
||||
else
|
||||
return l:counts
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#neomake#get_warnings()
|
||||
let counts = neomake#statusline#LoclistCounts()
|
||||
let counts = s:get_counts()
|
||||
let warnings = get(counts, 'W', 0)
|
||||
return warnings ? s:warning_symbol.warnings : ''
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#neomake#get_errors()
|
||||
let counts = neomake#statusline#LoclistCounts()
|
||||
let counts = s:get_counts()
|
||||
let errors = get(counts, 'E', 0)
|
||||
return errors ? s:error_symbol.errors : ''
|
||||
endfunction
|
||||
|
Loading…
Reference in New Issue
Block a user