convert branch/hunks/bufferline to function names.
This commit is contained in:
parent
e10b690cdf
commit
bdd758dd38
@ -31,6 +31,6 @@ function! airline#extensions#branch#get_head()
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#branch#init(ext)
|
||||
let g:airline_parts.branch = '%{airline#extensions#branch#get_head()}'
|
||||
let g:airline_parts.branch = 'airline#extensions#branch#get_head'
|
||||
endfunction
|
||||
|
||||
|
@ -54,6 +54,6 @@ function! airline#extensions#hunks#get_hunks()
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#hunks#init(ext)
|
||||
let g:airline_parts.hunks = '%{airline#extensions#hunks#get_hunks()}'
|
||||
let g:airline_parts.hunks = 'airline#extensions#hunks#get_hunks'
|
||||
endfunction
|
||||
|
||||
|
@ -2,12 +2,15 @@
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
function! s:get_val(part)
|
||||
let val = g:airline_parts[a:part]
|
||||
if match(val, '%') > -1
|
||||
return val
|
||||
else
|
||||
return '%{function("'.val.'")()}'
|
||||
if has_key(g:airline_parts, a:part)
|
||||
let val = g:airline_parts[a:part]
|
||||
if match(val, '%\| ') > -1
|
||||
return val
|
||||
else
|
||||
return '%{'.val.'()}'
|
||||
endif
|
||||
endif
|
||||
return a:part
|
||||
endfunction
|
||||
|
||||
function! airline#util#define_section(key, parts)
|
||||
|
@ -81,8 +81,8 @@ function! s:init()
|
||||
|
||||
call airline#extensions#load()
|
||||
call airline#util#define_section('a', ['mode', 'paste', 'iminsert'])
|
||||
call s:check_defined('g:airline_section_b', (g:airline_parts.hunks).(g:airline_parts.branch))
|
||||
call s:check_defined('g:airline_section_c', '%<'.(g:airline_parts.file))
|
||||
call airline#util#define_section('b', ['hunks', 'branch'])
|
||||
call airline#util#define_section('c', ['%<', 'file'])
|
||||
call s:check_defined('g:airline_section_gutter', ' '.(g:airline_parts.readonly).'%=')
|
||||
call s:check_defined('g:airline_section_x', (g:airline_parts.tagbar).'%{&filetype}')
|
||||
call s:check_defined('g:airline_section_y', g:airline_parts.ffenc)
|
||||
|
Loading…
Reference in New Issue
Block a user