add deprecation warnings.
This commit is contained in:
parent
4b9cda77dd
commit
14656f766b
|
@ -0,0 +1,21 @@
|
||||||
|
" MIT License. Copyright (c) 2013 Bailey Ling.
|
||||||
|
" vim: et ts=2 sts=2 sw=2
|
||||||
|
|
||||||
|
function! airline#deprecation#check()
|
||||||
|
if exists('g:airline_enable_fugitive') || exists('g:airline_fugitive_prefix')
|
||||||
|
echom 'The g:airline_enable_fugitive and g:airline_fugitive_prefix variables are obsolete. Please read the documentation about the branch extension.'
|
||||||
|
endif
|
||||||
|
|
||||||
|
let tests = [
|
||||||
|
\ [ 'g:airline_paste_symbol', 'g:airline_symbols.paste' ],
|
||||||
|
\ [ 'g:airline_readonly_symbol', 'g:airline_symbols.readonly' ],
|
||||||
|
\ [ 'g:airline_linecolumn_prefix', 'g:airline_symbols.linenr' ],
|
||||||
|
\ [ 'g:airline_branch_prefix', 'g:airline_symbols.branch' ],
|
||||||
|
\ ]
|
||||||
|
for test in tests
|
||||||
|
if exists(test[0])
|
||||||
|
echom printf('The variable %s is deprecated and may not work in the future. It has been replaced with %s', test[0], test[1])
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
endfunction
|
||||||
|
|
|
@ -195,8 +195,8 @@ function! airline#extensions#load()
|
||||||
|
|
||||||
" load all other extensions not part of the default distribution
|
" load all other extensions not part of the default distribution
|
||||||
for file in split(globpath(&rtp, "autoload/airline/extensions/*.vim"), "\n")
|
for file in split(globpath(&rtp, "autoload/airline/extensions/*.vim"), "\n")
|
||||||
" check to see that both the resolved and unresolved paths do not match
|
" we have to check both resolved and unresolved paths, since it's possible
|
||||||
" up with the path of the found extension
|
" that they might not get resolved properly (see #187)
|
||||||
if stridx(resolve(fnamemodify(file, ':p')), s:script_path) < 0
|
if stridx(resolve(fnamemodify(file, ':p')), s:script_path) < 0
|
||||||
\ && stridx(fnamemodify(file, ':p'), s:script_path) < 0
|
\ && stridx(fnamemodify(file, ':p'), s:script_path) < 0
|
||||||
let name = fnamemodify(file, ':t:r')
|
let name = fnamemodify(file, ':t:r')
|
||||||
|
|
|
@ -6,16 +6,14 @@ if &cp || v:version < 702 || (exists('g:loaded_airline') && g:loaded_airline)
|
||||||
endif
|
endif
|
||||||
let g:loaded_airline = 1
|
let g:loaded_airline = 1
|
||||||
|
|
||||||
|
" autocmd VimEnter * call airline#deprecation#check()
|
||||||
|
|
||||||
function! s:check_defined(variable, default)
|
function! s:check_defined(variable, default)
|
||||||
if !exists(a:variable)
|
if !exists(a:variable)
|
||||||
let {a:variable} = a:default
|
let {a:variable} = a:default
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
if exists('g:airline_enable_fugitive') || exists('g:airline_fugitive_prefix')
|
|
||||||
echom 'The g:airline_enable_fugitive and g:airline_fugitive_prefix variables are obsolete. Please read the documentation about the branch extension.'
|
|
||||||
endif
|
|
||||||
|
|
||||||
call s:check_defined('g:airline_left_sep', get(g:, 'airline_powerline_fonts', 0)?"":">")
|
call s:check_defined('g:airline_left_sep', get(g:, 'airline_powerline_fonts', 0)?"":">")
|
||||||
call s:check_defined('g:airline_left_alt_sep', get(g:, 'airline_powerline_fonts', 0)?"":">")
|
call s:check_defined('g:airline_left_alt_sep', get(g:, 'airline_powerline_fonts', 0)?"":">")
|
||||||
call s:check_defined('g:airline_right_sep', get(g:, 'airline_powerline_fonts', 0)?"":"<")
|
call s:check_defined('g:airline_right_sep', get(g:, 'airline_powerline_fonts', 0)?"":"<")
|
||||||
|
|
Loading…
Reference in New Issue