check guard for all extensions. resolves #241.

This commit is contained in:
Bailey Ling 2013-09-10 15:37:25 +00:00
parent 55f524de77
commit 3a5a40730a
12 changed files with 51 additions and 4 deletions

View File

@ -1,14 +1,18 @@
" MIT License. Copyright (c) 2013 Bailey Ling.
" vim: et ts=2 sts=2 sw=2
let s:empty_message = get(g:, 'airline#extensions#branch#empty_message',
\ get(g:, 'airline_branch_empty_message', ''))
let s:symbol = get(g:, 'airline#extensions#branch#symbol', g:airline_symbols.branch)
let s:has_fugitive = exists('*fugitive#head')
let s:has_fugitive_detect = exists('*fugitive#detect')
let s:has_lawrencium = exists('*lawrencium#statusline')
if !s:has_fugitive && !s:has_lawrencium
finish
endif
let s:empty_message = get(g:, 'airline#extensions#branch#empty_message',
\ get(g:, 'airline_branch_empty_message', ''))
let s:symbol = get(g:, 'airline#extensions#branch#symbol', g:airline_symbols.branch)
function! airline#extensions#branch#get_head()
let head = ''

View File

@ -1,6 +1,10 @@
" MIT License. Copyright (c) 2013 Bailey Ling.
" vim: et ts=2 sts=2 sw=2
if !exists('*bufferline#get_status_string')
finish
endif
let s:overwrite = get(g:, 'airline#extensions#bufferline#overwrite_variables', 1)
function! airline#extensions#bufferline#init(ext)

View File

@ -1,6 +1,10 @@
" MIT License. Copyright (c) 2013 Bailey Ling.
" vim: et ts=2 sts=2 sw=2
if !get(g:, 'command_t_loaded', 0)
finish
endif
function! airline#extensions#commandt#apply(...)
if bufname('%') ==# 'GoToFile'
call airline#extensions#apply_left_override('CommandT', '')

View File

@ -1,6 +1,10 @@
" MIT License. Copyright (c) 2013 Bailey Ling.
" vim: et ts=2 sts=2 sw=2
if !get(g:, 'loaded_csv', 0)
finish
endif
let s:column_display = get(g:, 'airline#extensions#csv#column_display', 'Number')
function! airline#extensions#csv#get_column()

View File

@ -1,6 +1,10 @@
" MIT License. Copyright (c) 2013 Bailey Ling.
" vim: et ts=2 sts=2 sw=2
if !get(g:, 'loaded_ctrlp', 0)
finish
endif
let s:color_template = get(g:, 'airline#extensions#ctrlp#color_template', 'insert')
function! airline#extensions#ctrlp#generate_color_map(dark, light, white)

View File

@ -1,6 +1,9 @@
" MIT License. Copyright (c) 2013 Bailey Ling.
" vim: et ts=2 sts=2 sw=2
" we don't actually want this loaded :P
finish
" Extension specific variables can be defined the usual fashion.
if !exists('g:airline#extensions#example#number_of_cats')
let g:airline#extensions#example#number_of_cats = 42

View File

@ -1,6 +1,10 @@
" MIT License. Copyright (c) 2013 Bailey Ling.
" vim: et ts=2 sts=2 sw=2
if !get(g:, 'loaded_signify', 0) && !get(g:, 'loaded_gitgutter', 0)
finish
endif
let s:non_zero_only = get(g:, 'airline#extensions#hunks#non_zero_only', 0)
let s:hunk_symbols = get(g:, 'airline#extensions#hunks#hunk_symbols', ['+', '~', '-'])

View File

@ -1,6 +1,10 @@
" MIT License. Copyright (c) 2013 Bailey Ling.
" vim: et ts=2 sts=2 sw=2
if !exists(':SyntasticCheck')
finish
endif
function! airline#extensions#syntastic#get_warnings()
let errors = SyntasticStatuslineFlag()
if strlen(errors) > 0

View File

@ -1,6 +1,10 @@
" MIT License. Copyright (c) 2013 Bailey Ling.
" vim: et ts=2 sts=2 sw=2
if !exists(':TagbarToggle')
finish
endif
let s:flags = get(g:, 'airline#extensions#tagbar#flags', '')
" Arguments: current, sort, fname

View File

@ -1,6 +1,10 @@
" MIT License. Copyright (c) 2013 Bailey Ling.
" vim: et ts=2 sts=2 sw=2
if !exists(':UndotreeToggle')
finish
endif
function! airline#extensions#undotree#apply(...)
if exists('t:undotree')
if &ft == 'undotree'

View File

@ -1,6 +1,10 @@
" MIT License. Copyright (c) 2013 Bailey Ling.
" vim: et ts=2 sts=2 sw=2
if !get(g:, 'loaded_unite', 0)
finish
endif
function! airline#extensions#unite#apply(...)
if &ft == 'unite'
call a:1.add_section('airline_a', ' Unite ')

View File

@ -1,6 +1,10 @@
" MIT License. Copyright (c) 2013 Bailey Ling.
" vim: et ts=2 sts=2 sw=2
if !get(g:, 'virtualenv_loaded', 0)
finish
endif
function! airline#extensions#virtualenv#init(ext)
call a:ext.add_statusline_func('airline#extensions#virtualenv#apply')
endfunction