Merge pull request #2416 from zeertzjq/gina-initialized

Don't show "gina" in diff buffers if `b:gina_initialized` is not set
This commit is contained in:
Christian Brabandt 2021-08-09 20:59:40 +02:00 committed by GitHub
commit 2259e5c93e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,7 +8,11 @@ if !get(g:, 'loaded_gina', 0)
endif
function! airline#extensions#gina#apply(...) abort
if (&ft =~# 'gina' && &ft !~# 'blame') || &ft ==# 'diff'
" gina.vim seems to set b:gina_initialized = 1 in diff buffers it open,
" where get(b:, 'gina_initialized', 0) returns 1.
" In diff buffers not opened by gina.vim b:gina_initialized is not set,
" so get(b:, 'gina_initialized', 0) returns 0.
if (&ft =~# 'gina' && &ft !~# 'blame') || (&ft ==# 'diff' && get(b:, 'gina_initialized', 0))
call a:1.add_section('airline_a', ' gina ')
call a:1.add_section('airline_b', ' %{gina#component#repo#branch()} ')
call a:1.split()