From 389650645b218d72d376277d3734c541b77a4a2d Mon Sep 17 00:00:00 2001 From: Bailey Ling Date: Sat, 31 Aug 2013 11:55:00 -0400 Subject: [PATCH] always run the extensions/core funcrefs last. this ensures the user always has priority in customizations. --- autoload/airline.vim | 5 ++++- autoload/airline/extensions.vim | 5 +---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/autoload/airline.vim b/autoload/airline.vim index 63fc270b..19258374 100644 --- a/autoload/airline.vim +++ b/autoload/airline.vim @@ -84,9 +84,12 @@ function! airline#update_statusline() call s:invoke_funcrefs(context, g:airline_statusline_funcrefs) endfunction +let s:core_funcrefs = [ + \ function('airline#extensions#apply'), + \ function('airline#extensions#default#apply') ] function! s:invoke_funcrefs(context, funcrefs) let builder = airline#builder#new(a:context) - let err = airline#util#exec_funcrefs(a:funcrefs + [function('airline#extensions#default#apply')], builder, a:context) + let err = airline#util#exec_funcrefs(a:funcrefs + s:core_funcrefs, builder, a:context) if err == 1 call setwinvar(a:context.winnr, '&statusline', builder.build()) endif diff --git a/autoload/airline/extensions.vim b/autoload/airline/extensions.vim index 744a4985..e9c72f62 100644 --- a/autoload/airline/extensions.vim +++ b/autoload/airline/extensions.vim @@ -51,7 +51,7 @@ function! airline#extensions#apply_left_override(section1, section2) endfunction let s:active_winnr = -1 -function! airline#extensions#update_statusline(...) +function! airline#extensions#apply(...) if s:is_excluded_window() return -1 endif @@ -124,9 +124,6 @@ function! airline#extensions#load() " non-trivial number of external plugins use eventignore=all, so we need to account for that autocmd CursorMoved * call sync_active_winnr() - " load core funcrefs - call airline#add_statusline_func('airline#extensions#update_statusline') - if get(g:, 'loaded_unite', 0) call airline#extensions#unite#init(s:ext) endif