From e79188c3bd32c3ce5f50c29bd573fc7a47e3b48d Mon Sep 17 00:00:00 2001 From: Reuben D'Netto Date: Fri, 21 Jul 2017 18:30:34 +1000 Subject: [PATCH] Neomake integration: if loclist is empty, fallback to quickfix --- autoload/airline/extensions/neomake.vim | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/autoload/airline/extensions/neomake.vim b/autoload/airline/extensions/neomake.vim index 6587f87..08fe5bc 100644 --- a/autoload/airline/extensions/neomake.vim +++ b/autoload/airline/extensions/neomake.vim @@ -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