diff --git a/autoload/airline/extensions/branch.vim b/autoload/airline/extensions/branch.vim index feac6ff9..4b35e467 100644 --- a/autoload/airline/extensions/branch.vim +++ b/autoload/airline/extensions/branch.vim @@ -1,19 +1,14 @@ " MIT license. Copyright (c) 2013 Bailey Ling. " vim: ts=2 sts=2 sw=2 fdm=indent -function! airline#extensions#branch#apply() - if exists('w:airline_left_only') - return - endif - let w:airline_section_b = - \ exists('*fugitive#head') && strlen(fugitive#head()) > 0 - \ ? g:airline_branch_prefix.fugitive#head() - \ : exists('*lawrencium#statusline') && strlen(lawrencium#statusline()) > 0 - \ ? g:airline_branch_prefix.lawrencium#statusline() - \ : '' -endfunction - function! airline#extensions#branch#init(ext) - call a:ext.add_statusline_funcref(function('airline#extensions#branch#apply')) + if g:airline_section_b == '' + let g:airline_section_b = + \ exists('*fugitive#head') && strlen(fugitive#head()) > 0 + \ ? g:airline_branch_prefix.fugitive#head() + \ : exists('*lawrencium#statusline') && strlen(lawrencium#statusline()) > 0 + \ ? g:airline_branch_prefix.lawrencium#statusline() + \ : '' + endif endfunction diff --git a/autoload/airline/extensions/bufferline.vim b/autoload/airline/extensions/bufferline.vim index 55fda123..852b33cf 100644 --- a/autoload/airline/extensions/bufferline.vim +++ b/autoload/airline/extensions/bufferline.vim @@ -1,13 +1,6 @@ " MIT license. Copyright (c) 2013 Bailey Ling. " vim: ts=2 sts=2 sw=2 fdm=indent -function! airline#extensions#bufferline#apply() - if exists('w:airline_left_only') - return - endif - let w:airline_section_c = '%{bufferline#refresh_status()}'.bufferline#get_status_string() -endfunction - function! airline#extensions#bufferline#init(ext) highlight AlBl_active gui=bold cterm=bold term=bold highlight link AlBl_inactive Al6 @@ -17,5 +10,7 @@ function! airline#extensions#bufferline#init(ext) let g:bufferline_active_buffer_right = '' let g:bufferline_separator = ' ' - call a:ext.add_statusline_funcref(function('airline#extensions#bufferline#apply')) + if g:airline_section_c == '%f%m' + let g:airline_section_c = '%{bufferline#refresh_status()}'.bufferline#get_status_string() + endif endfunction diff --git a/autoload/airline/extensions/syntastic.vim b/autoload/airline/extensions/syntastic.vim index f77cfd6b..d6b386db 100644 --- a/autoload/airline/extensions/syntastic.vim +++ b/autoload/airline/extensions/syntastic.vim @@ -1,12 +1,8 @@ " MIT license. Copyright (c) 2013 Bailey Ling. " vim: ts=2 sts=2 sw=2 fdm=indent -function! airline#extensions#syntastic#apply() - let w:airline_section_gutter = '%#warningmsg#%{SyntasticStatuslineFlag()}' -endfunction - function! airline#extensions#syntastic#init(ext) - if g:airline_enable_syntastic && exists('*SyntasticStatuslineFlag') - call a:ext.add_statusline_funcref(function('airline#extensions#syntastic#apply')) + if g:airline_section_gutter == '' + let g:airline_section_gutter = '%#warningmsg#%{SyntasticStatuslineFlag()}' endif endfunction