add ability to override left/right sides independently

This commit is contained in:
Bailey Ling 2013-08-10 16:05:49 +00:00
parent e67fa32fd9
commit 61a39a99ac
2 changed files with 8 additions and 8 deletions

View File

@ -79,7 +79,7 @@ function! s:get_statusline(winnr, active)
let l:file_flag_color = a:active ? "%#Al7#" : "%#Al7_inactive#"
let sl = '%{airline#update_highlight()}'
if a:active || s:getwinvar(a:winnr, 'airline_left_only', 0)
if s:getwinvar(a:winnr, 'airline_render_left', a:active)
let sl.=l:mode_color.s:get_section(a:winnr, 'a')
let sl.='%{g:airline_detect_paste && &paste ? g:airline_paste_symbol." " : ""}'
let sl.=l:mode_sep_color
@ -95,7 +95,7 @@ function! s:get_statusline(winnr, active)
else
let sl.=l:status_color.' %f%m'
endif
if !s:getwinvar(a:winnr, 'airline_left_only', 0)
if s:getwinvar(a:winnr, 'airline_render_right', 1)
let sl.='%='
let sl.=s:get_section(a:winnr, 'x')
let sl.=l:info_sep_color
@ -146,7 +146,8 @@ function! airline#update_statusline()
let w:airline_active = 1
unlet! w:airline_left_only
unlet! w:airline_render_left
unlet! w:airline_render_right
for section in s:sections
unlet! w:airline_section_{section}
endfor

View File

@ -28,7 +28,8 @@ function! airline#extensions#apply_left_override(section1, section2)
let w:airline_section_b = a:section2
let w:airline_section_c = ''
let w:airline_section_gutter = ' '
let w:airline_left_only = 1
let w:airline_render_left = 1
let w:airline_render_right = 0
endfunction
let s:active_winnr = -1
@ -41,12 +42,10 @@ function! airline#extensions#update_statusline()
let w:airline_section_c = ''
let w:airline_section_x = ''
elseif &buftype == 'help'
let w:airline_section_a = 'Help'
let w:airline_section_b = '%f'
let w:airline_section_c = ''
let w:airline_section_gutter = ' '
call airline#extensions#apply_left_override('Help', '%f')
let w:airline_section_x = ''
let w:airline_section_y = ''
let w:airline_render_right = 1
endif
if &previewwindow