diff --git a/autoload/airline/extensions/example.vim b/autoload/airline/extensions/example.vim index d522bd6..0f571f2 100644 --- a/autoload/airline/extensions/example.vim +++ b/autoload/airline/extensions/example.vim @@ -11,7 +11,7 @@ function! airline#extensions#example#init(ext) " Here we define a new part for the plugin. This allows users to place this " extension in arbitrary locations. - let g:airline_parts.cats = '%{airline#extensions#example#get_cats()}' + call airline#parts#define_raw('cats', '%{airline#extensions#example#get_cats()}') " Next up we add a funcref so that we can run some code prior to the " statusline getting modifed. @@ -28,7 +28,7 @@ function! airline#extensions#example#apply(...) " Let's use a helper function. It will take care of ensuring that the " window-local override exists (and create one based on the global " airline_section if not), and prepend to it. - call airline#extensions#prepend_to_section('x', g:airline_parts.cats) + call airline#extensions#prepend_to_section('x', airline#parts#get('cats').raw) endif endfunction diff --git a/autoload/airline/extensions/syntastic.vim b/autoload/airline/extensions/syntastic.vim index 24308c5..a91ec66 100644 --- a/autoload/airline/extensions/syntastic.vim +++ b/autoload/airline/extensions/syntastic.vim @@ -10,6 +10,6 @@ function! airline#extensions#syntastic#get_warnings() endfunction function! airline#extensions#syntastic#init(ext) - let g:airline_parts.syntastic = '%{airline#extensions#syntastic#get_warnings()}' + call airline#parts#define_function('syntastic', 'airline#extensions#syntastic#get_warnings') endfunction diff --git a/autoload/airline/extensions/tagbar.vim b/autoload/airline/extensions/tagbar.vim index 4b51787..214d443 100644 --- a/autoload/airline/extensions/tagbar.vim +++ b/autoload/airline/extensions/tagbar.vim @@ -27,6 +27,6 @@ function! airline#extensions#tagbar#init(ext) call a:ext.add_inactive_statusline_func('airline#extensions#tagbar#inactive_apply') let g:tagbar_status_func = 'airline#extensions#tagbar#get_status' - let g:airline_parts.tagbar = 'airline#extensions#tagbar#currenttag' + call airline#parts#define_function('tagbar', 'airline#extensions#tagbar#currenttag') endfunction diff --git a/autoload/airline/extensions/whitespace.vim b/autoload/airline/extensions/whitespace.vim index 0aa8fbe..234c732 100644 --- a/autoload/airline/extensions/whitespace.vim +++ b/autoload/airline/extensions/whitespace.vim @@ -65,7 +65,7 @@ function! airline#extensions#whitespace#toggle() endfunction function! airline#extensions#whitespace#init(...) - let g:airline_parts.whitespace = '%{airline#extensions#whitespace#check()}' + call airline#parts#define_function('whitespace', 'airline#extensions#whitespace#check') unlet! b:airline_whitespace_check augroup airline_whitespace diff --git a/autoload/airline/init.vim b/autoload/airline/init.vim index a08542b..80ab516 100644 --- a/autoload/airline/init.vim +++ b/autoload/airline/init.vim @@ -37,14 +37,7 @@ function! airline#init#bootstrap() \ 'highlight': 'airline_file', \ }) call airline#parts#define_raw('file', '%f%m') - - call s:check_defined('g:airline_parts', {}) - call extend(g:airline_parts, { - \ 'ffenc': '%{printf("%s%s",&fenc,strlen(&ff)>0?"[".&ff."]":"")}', - \ 'tagbar': 'airline#parts#empty', - \ 'syntastic': 'airline#parts#empty', - \ 'whitespace': 'airline#parts#empty', - \ }, 'keep') + call airline#parts#define_raw('ffenc', '%{printf("%s%s",&fenc,strlen(&ff)>0?"[".&ff."]":"")}') call s:check_defined('g:airline_mode_map', {}) call extend(g:airline_mode_map, { diff --git a/doc/airline.txt b/doc/airline.txt index 5bcac27..4159728 100644 --- a/doc/airline.txt +++ b/doc/airline.txt @@ -388,9 +388,6 @@ For contributions into the plugin, here are the following guidelines: b. Configuration variables for the extension should reside in the extension, e.g. `g:airline#extensions#foo_plugin#bar_variable`. - c. A value should be added to the `g:airline_parts` dictionary such that - the extension can be arbitrarily positioned. - See the source of |example.vim| for a working extension. ==============================================================================