From 161daa79426889d722c52569e9b1e1e277be9168 Mon Sep 17 00:00:00 2001 From: Bailey Ling Date: Sat, 27 Jul 2013 18:15:00 -0400 Subject: [PATCH] deprecate fugitive variable names in favour of scm-agnostic variable names --- autoload/airline.vim | 10 +++++++--- doc/airline.txt | 10 +++++----- plugin/airline.vim | 9 ++++++--- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/autoload/airline.vim b/autoload/airline.vim index f1c8f64..1a0b961 100644 --- a/autoload/airline.vim +++ b/autoload/airline.vim @@ -74,9 +74,13 @@ function! airline#update_externals() \ ? '%{bufferline#refresh_status()}'.bufferline#get_status_string() \ : "%f%m" let g:airline_externals_syntastic = g:airline_enable_syntastic && exists('*SyntasticStatuslineFlag') ? '%{SyntasticStatuslineFlag()}' : '' - let g:airline_externals_fugitive = g:airline_enable_fugitive ? (exists('*fugitive#head') && strlen(fugitive#head()) > 0 - \ ? g:airline_fugitive_prefix.fugitive#head() : exists('*lawrencium#statusline') && strlen(lawrencium#statusline()) > 0 - \ ? g:airline_fugitive_prefix.lawrencium#statusline() : '') : '' + let g:airline_externals_branch = g:airline_enable_branch + \ ? (exists('*fugitive#head') && strlen(fugitive#head()) > 0 + \ ? g:airline_branch_prefix.fugitive#head() + \ : exists('*lawrencium#statusline') && strlen(lawrencium#statusline()) > 0 + \ ? g:airline_branch_prefix.lawrencium#statusline() + \ : '') + \ : '' endfunction function! s:get_section(key) diff --git a/doc/airline.txt b/doc/airline.txt index 31c3892..9e6f9d5 100644 --- a/doc/airline.txt +++ b/doc/airline.txt @@ -51,7 +51,7 @@ values): * enable/disable fugitive/lawrencium integration > - let g:airline_enable_fugitive=1 + let g:airline_enable_branch=1 < * enable/disable syntastic integration @@ -127,7 +127,7 @@ separators, as well as the powerline font glyths. let g:airline_linecolumn_prefix = '␊ ' let g:airline_linecolumn_prefix = '␤ ' let g:airline_linecolumn_prefix = '¶ ' - let g:airline_fugitive_prefix = '⎇ ' + let g:airline_branch_prefix = '⎇ ' let g:airline_paste_symbol = 'ρ' let g:airline_paste_symbol = 'Þ' let g:airline_paste_symbol = '∥' @@ -137,7 +137,7 @@ separators, as well as the powerline font glyths. let g:airline_left_alt_sep = '' let g:airline_right_sep = '' let g:airline_right_alt_sep = '' - let g:airline_fugitive_prefix = ' ' + let g:airline_branch_prefix = ' ' let g:airline_readonly_symbol = '' let g:airline_linecolumn_prefix = ' ' @@ -146,7 +146,7 @@ separators, as well as the powerline font glyths. let g:airline_left_alt_sep = '⮁' let g:airline_right_sep = '⮂' let g:airline_right_alt_sep = '⮃' - let g:airline_fugitive_prefix = '⭠' + let g:airline_branch_prefix = '⭠' let g:airline_readonly_symbol = '⭤' let g:airline_linecolumn_prefix = '⭡' < @@ -164,7 +164,7 @@ with the usual statusline syntax. let g:airline_section_y (fileencoding, fileformat) let g:airline_section_z (percentage, line number, column number) - " here is an example of how you could replace the fugitive indicator with + " here is an example of how you could replace the branch indicator with " the current working directory, followed by the filename. let g:airline_section_b = '%{getcwd()}' let g:airline_section_c = '%t' diff --git a/plugin/airline.vim b/plugin/airline.vim index 865cbe2..a8d643c 100644 --- a/plugin/airline.vim +++ b/plugin/airline.vim @@ -8,17 +8,20 @@ function! s:check_defined(variable, default) let {a:variable} = a:default endif endfunction +if exists('g:airline_enable_fugitive') || exists('g:airline_fugitive_prefix') + echom 'The g:airline_enable_fugitive and g:airline_fugitive_prefix variables have been deprecated and renamed to g:airline_enable_branch and g:airline_branch_prefix respectively. Please update your vimrc.' +endif call s:check_defined('g:airline_left_sep', exists('g:airline_powerline_fonts')?"":">") call s:check_defined('g:airline_left_alt_sep', exists('g:airline_powerline_fonts')?"":">") call s:check_defined('g:airline_right_sep', exists('g:airline_powerline_fonts')?"":"<") call s:check_defined('g:airline_right_alt_sep', exists('g:airline_powerline_fonts')?"":"<") call s:check_defined('g:airline_enable_bufferline', 1) -call s:check_defined('g:airline_enable_fugitive', 1) +call s:check_defined('g:airline_enable_branch', 1) call s:check_defined('g:airline_enable_syntastic', 1) call s:check_defined('g:airline_detect_iminsert', 0) call s:check_defined('g:airline_detect_modified', 1) call s:check_defined('g:airline_detect_paste', 1) -call s:check_defined('g:airline_fugitive_prefix', exists('g:airline_powerline_fonts')?' ':'') +call s:check_defined('g:airline_branch_prefix', exists('g:airline_powerline_fonts')?' ':'') call s:check_defined('g:airline_readonly_symbol', exists('g:airline_powerline_fonts')?'':'RO') call s:check_defined('g:airline_linecolumn_prefix', exists('g:airline_powerline_fonts')?' ':':') call s:check_defined('g:airline_paste_symbol', (exists('g:airline_powerline_fonts') ? ' ' : '').'PASTE') @@ -46,7 +49,7 @@ function! s:init() call airline#update_externals() call airline#load_theme(g:airline_theme) call s:check_defined('g:airline_section_a', '%{g:airline_current_mode_text}') - call s:check_defined('g:airline_section_b', '%{g:airline_externals_fugitive}') + call s:check_defined('g:airline_section_b', '%{g:airline_externals_branch}') call s:check_defined('g:airline_section_c', g:airline_externals_bufferline) call s:check_defined('g:airline_section_gutter', '') call s:check_defined('g:airline_section_x', "%{strlen(&filetype)>0?&filetype:''}")