Merge pull request #2256 from Kamilcuk/master

Add gen_tags.vim plugin support
This commit is contained in:
Christian Brabandt 2020-10-29 13:41:35 +01:00 committed by GitHub
commit 38c9f9ca3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 34 additions and 2 deletions

View File

@ -17,6 +17,7 @@ This is the Changelog for the vim-airline project.
- [Vim-CMake](https://github.com/cdelledonne/vim-cmake) support
- [battery.vim](https://github.com/lambdalisue/battery.vim) support
- [nvim-lspconfig](https://github.com/neovim/nvim-lspconfig) support
- [gen_tags.vim](https://github.com/jsfaint/gen_tags.vim) support
- Improvements
- git branch can also be displayed using [gina.vim](https://github.com/lambdalisue/gina.vim)
- coc extensions can also show additional status messages

View File

@ -408,6 +408,11 @@ function! airline#extensions#load()
call add(s:loaded_ext, 'gutentags')
endif
if get(g:, 'airline#extensions#gen_tags#enabled', 1) && (get(g:, 'loaded_gentags#gtags', 0) || get(g:, 'loaded_gentags#ctags', 0))
call airline#extensions#gen_tags#init(s:ext)
call add(s:loaded_ext, 'gen_tags')
endif
if (get(g:, 'airline#extensions#grepper#enabled', 1) && get(g:, 'loaded_grepper', 0))
call airline#extensions#grepper#init(s:ext)
call add(s:loaded_ext, 'grepper')

View File

@ -0,0 +1,19 @@
" MIT License. Copyright (c) 2014-2020 Mathias Andersson et al.
" Written by Kamil Cukrowski 2020
" Plugin: https://github.com/jsfaint/gen_tags.vim
" vim: et ts=2 sts=2 sw=2
scriptencoding utf-8
if !(get(g:, 'loaded_gentags#gtags', 0) || !get(g:, 'loaded_gentags#ctags', 0))
finish
endif
function! airline#extensions#gen_tags#status(...) abort
return gen_tags#job#is_running() != 0 ? 'Gen. gen_tags' : ''
endfunction
function! airline#extensions#gen_tags#init(ext) abort
call airline#parts#define_function('gen_tags', 'airline#extensions#gen_tags#status')
endfunction

View File

@ -176,6 +176,7 @@ function! airline#init#bootstrap()
call airline#parts#define_text('bookmark', '')
call airline#parts#define_text('capslock', '')
call airline#parts#define_text('gutentags', '')
call airline#parts#define_text('gen_tags', '')
call airline#parts#define_text('grepper', '')
call airline#parts#define_text('xkblayout', '')
call airline#parts#define_text('keymap', '')
@ -211,7 +212,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', 'vista', 'gutentags', 'omnisharp', 'grepper', 'filetype'])
let g:airline_section_x = airline#section#create_right(['bookmark', 'tagbar', 'vista', 'gutentags', 'gen_tags', 'omnisharp', 'grepper', 'filetype'])
endif
if !exists('g:airline_section_y')
let g:airline_section_y = airline#section#create_right(['ffenc'])

View File

@ -787,6 +787,12 @@ vim-gutentags <https://github.com/ludovicchabant/vim-gutentags>
* enable/disable vim-gutentags integration >
let g:airline#extensions#gutentags#enabled = 1
------------------------------------- *gen_tags.vim*
gen_tags.vim <https://github.com/jsfaint/gen_tags.vim>
* enable/disable gen_tags.vim integration >
let g:airline#extensions#gen_tags#enabled = 1
------------------------------------- *airline-hunks*
vim-gitgutter <https://github.com/airblade/vim-gitgutter>
vim-signify <https://github.com/mhinz/vim-signify>

View File

@ -34,7 +34,7 @@ describe 'init sections'
end
it 'section x should be filetype'
Expect g:airline_section_x == '%{airline#util#prepend("",0)}%{airline#util#prepend("",0)}%{airline#util#prepend("",0)}%{airline#util#prepend("",0)}%{airline#util#wrap(airline#parts#filetype(),0)}'
Expect g:airline_section_x == '%{airline#util#prepend("",0)}%{airline#util#prepend("",0)}%{airline#util#prepend("",0)}%{airline#util#prepend("",0)}%{airline#util#prepend("",0)}%{airline#util#wrap(airline#parts#filetype(),0)}'
end
it 'section y should be fenc and ff'