branch: Make the branch extension available with 80 char wide windows

This commit is contained in:
Christian Brabandt 2019-04-24 16:12:54 +02:00
parent 9f193de600
commit ffd8c406ab
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09
2 changed files with 5 additions and 2 deletions

View File

@ -158,7 +158,7 @@ function! airline#init#bootstrap()
\ 'minwidth': 100})
call airline#parts#define('branch', {
\ 'raw': '',
\ 'minwidth': 120})
\ 'minwidth': 80})
call airline#parts#define_empty(['obsession', 'tagbar', 'syntastic-warn',
\ 'syntastic-err', 'eclim', 'whitespace','windowswap',
\ 'ycm_error_count', 'ycm_warning_count', 'neomake_error_count',
@ -202,7 +202,7 @@ function! airline#init#sections()
let g:airline_section_y = airline#section#create_right(['ffenc'])
endif
if !exists('g:airline_section_z')
if airline#util#winwidth() > 80
if airline#util#winwidth() > 79
let g:airline_section_z = airline#section#create(['windowswap', 'obsession', '%3p%%'.spc, 'linenr', 'maxlinenr', spc.':%3v'])
else
let g:airline_section_z = airline#section#create(['%3p%%'.spc, 'linenr', ':%3v'])

View File

@ -438,6 +438,9 @@ If a file is edited, that is not yet in the repository, the
notexists symbol will be displayed after the branch name. If the repository is
not clean, the dirty symbol will be displayed after the branch name.
Note: the branch extension will be disabled for windows smaller than 80
characters.
* enable/disable fugitive/lawrencium integration >
let g:airline#extensions#branch#enabled = 1
<