diff --git a/autoload/airline/extensions.vim b/autoload/airline/extensions.vim index 112abf8..c594497 100644 --- a/autoload/airline/extensions.vim +++ b/autoload/airline/extensions.vim @@ -213,6 +213,11 @@ function! airline#extensions#load() call add(s:loaded_ext, 'tagbar') endif + if get(g:, 'airline#extensions#vista#enabled', 1) + call airline#extensions#vista#init(s:ext) + call add(s:loaded_ext, 'vista') + endif + if get(g:, 'airline#extensions#bookmark#enabled', 1) \ && exists(':BookmarkToggle') call airline#extensions#bookmark#init(s:ext) diff --git a/autoload/airline/extensions/vista.vim b/autoload/airline/extensions/vista.vim new file mode 100644 index 0000000..a62bb54 --- /dev/null +++ b/autoload/airline/extensions/vista.vim @@ -0,0 +1,14 @@ +" MIT License. Copyright (c) 2019 s1341 (github@shmarya.net) +" vim: et ts=2 sts=2 sw=2 + +scriptencoding utf-8 + +function! airline#extensions#vista#currenttag() + if get(w:, 'airline_active', 0) + return get(b:, 'vista_nearest_method_or_function', '') + endif +endfunction + +function! airline#extensions#vista#init(ext) + call airline#parts#define_function('vista', 'airline#extensions#vista#currenttag') +endfunction diff --git a/autoload/airline/init.vim b/autoload/airline/init.vim index 1a68489..18d22ce 100644 --- a/autoload/airline/init.vim +++ b/autoload/airline/init.vim @@ -166,7 +166,7 @@ function! airline#init#bootstrap() \ 'ycm_error_count', 'ycm_warning_count', 'neomake_error_count', \ 'neomake_warning_count', 'ale_error_count', 'ale_warning_count', \ 'languageclient_error_count', 'languageclient_warning_count', - \ 'coc_warning_count', 'coc_error_count']) + \ 'coc_warning_count', 'coc_error_count', 'vista']) call airline#parts#define_text('bookmark', '') call airline#parts#define_text('capslock', '') call airline#parts#define_text('gutentags', '') @@ -200,7 +200,7 @@ function! airline#init#sections() let g:airline_section_gutter = airline#section#create(['%=']) endif if !exists('g:airline_section_x') - let g:airline_section_x = airline#section#create_right(['bookmark', 'tagbar', 'gutentags', 'grepper', 'filetype']) + let g:airline_section_x = airline#section#create_right(['bookmark', 'tagbar', 'vista', 'gutentags', 'grepper', 'filetype']) endif if !exists('g:airline_section_y') let g:airline_section_y = airline#section#create_right(['ffenc']) diff --git a/doc/airline.txt b/doc/airline.txt index 0097792..83ad514 100644 --- a/doc/airline.txt +++ b/doc/airline.txt @@ -1167,6 +1167,12 @@ virtualenv * enable/disable virtualenv integration > let g:airline#extensions#virtualenv#enabled = 1 < +------------------------------------- *airline-vista* +vista.vim + +* enable/disable vista integration > + let g:airline#extensions#vista#enabled = 1 + ------------------------------------- *airline-whitespace* * enable/disable detection of whitespace errors. > let g:airline#extensions#whitespace#enabled = 1