collapse section when it is empty text (#70).

This commit is contained in:
Bailey Ling 2013-08-04 01:37:34 +00:00
parent e4d5f4cfb1
commit 926be0bd8a

View File

@ -60,7 +60,7 @@ endfunction
function! s:get_section(winnr, key, ...)
let text = s:getwinvar(a:winnr, 'airline_section_'.a:key, g:airline_section_{a:key})
let [prefix, suffix] = [get(a:000, 0, ' '), get(a:000, 1, ' ')]
let [prefix, suffix] = [get(a:000, 0, '%( '), get(a:000, 1, ' %)')]
return empty(text) ? '' : prefix.text.suffix
endfunction