place hunks and branch extension into parts.
This commit is contained in:
parent
3d3d93e135
commit
2708951715
@ -31,6 +31,6 @@ function! airline#extensions#branch#get_head()
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! airline#extensions#branch#init(ext)
|
function! airline#extensions#branch#init(ext)
|
||||||
let g:airline_section_b .= '%{airline#extensions#branch#get_head()}'
|
let g:airline_parts.branch = '%{airline#extensions#branch#get_head()}'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
@ -54,6 +54,6 @@ function! airline#extensions#hunks#get_hunks()
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! airline#extensions#hunks#init(ext)
|
function! airline#extensions#hunks#init(ext)
|
||||||
let g:airline_section_b .= '%{airline#extensions#hunks#get_hunks()}'
|
let g:airline_parts.hunks = '%{airline#extensions#hunks#get_hunks()}'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
@ -44,6 +44,8 @@ call extend(g:airline_parts, {
|
|||||||
\ 'paste': '%{airline#parts#paste()}',
|
\ 'paste': '%{airline#parts#paste()}',
|
||||||
\ 'readonly': '%#airline_file#%{airline#parts#readonly()}',
|
\ 'readonly': '%#airline_file#%{airline#parts#readonly()}',
|
||||||
\ 'ffenc': '%{printf("%s%s",&fenc,strlen(&ff)>0?"[".&ff."]":"")}',
|
\ 'ffenc': '%{printf("%s%s",&fenc,strlen(&ff)>0?"[".&ff."]":"")}',
|
||||||
|
\ 'hunks': '',
|
||||||
|
\ 'branch': '',
|
||||||
\ }, 'keep')
|
\ }, 'keep')
|
||||||
|
|
||||||
call s:check_defined('g:airline_mode_map', {})
|
call s:check_defined('g:airline_mode_map', {})
|
||||||
@ -69,15 +71,6 @@ call extend(g:airline_theme_map, {
|
|||||||
\ '.*solarized.*': 'solarized',
|
\ '.*solarized.*': 'solarized',
|
||||||
\ }, 'keep')
|
\ }, 'keep')
|
||||||
|
|
||||||
call s:check_defined('g:airline_section_a', (g:airline_parts.mode).(g:airline_parts.paste).(g:airline_parts.iminsert))
|
|
||||||
call s:check_defined('g:airline_section_b', '')
|
|
||||||
call s:check_defined('g:airline_section_c', '%f%m')
|
|
||||||
call s:check_defined('g:airline_section_gutter', ' '.(g:airline_parts.readonly).'%=')
|
|
||||||
call s:check_defined('g:airline_section_x', '%{&filetype}')
|
|
||||||
call s:check_defined('g:airline_section_y', g:airline_parts.ffenc)
|
|
||||||
call s:check_defined('g:airline_section_z', '%3p%% %{g:airline_symbols.linenr} %3l:%3c')
|
|
||||||
call s:check_defined('g:airline_section_warning', '__')
|
|
||||||
|
|
||||||
let s:airline_initialized = 0
|
let s:airline_initialized = 0
|
||||||
let s:airline_theme_defined = 0
|
let s:airline_theme_defined = 0
|
||||||
function! s:init()
|
function! s:init()
|
||||||
@ -85,6 +78,14 @@ function! s:init()
|
|||||||
let s:airline_initialized = 1
|
let s:airline_initialized = 1
|
||||||
|
|
||||||
call airline#extensions#load()
|
call airline#extensions#load()
|
||||||
|
call s:check_defined('g:airline_section_a', (g:airline_parts.mode).(g:airline_parts.paste).(g:airline_parts.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', '%f%m')
|
||||||
|
call s:check_defined('g:airline_section_gutter', ' '.(g:airline_parts.readonly).'%=')
|
||||||
|
call s:check_defined('g:airline_section_x', '%{&filetype}')
|
||||||
|
call s:check_defined('g:airline_section_y', g:airline_parts.ffenc)
|
||||||
|
call s:check_defined('g:airline_section_z', '%3p%% %{g:airline_symbols.linenr} %3l:%3c')
|
||||||
|
call s:check_defined('g:airline_section_warning', '__')
|
||||||
|
|
||||||
let s:airline_theme_defined = exists('g:airline_theme')
|
let s:airline_theme_defined = exists('g:airline_theme')
|
||||||
if s:airline_theme_defined || !airline#switch_matching_theme()
|
if s:airline_theme_defined || !airline#switch_matching_theme()
|
||||||
|
Loading…
Reference in New Issue
Block a user