rename fragments to parts.

This commit is contained in:
Bailey Ling 2013-08-27 18:08:50 +00:00
parent 83a1d7e47c
commit 85c1f5ad03
2 changed files with 10 additions and 10 deletions

View File

@ -1,18 +1,18 @@
" MIT License. Copyright (c) 2013 Bailey Ling. " MIT License. Copyright (c) 2013 Bailey Ling.
" vim: et ts=2 sts=2 sw=2 " vim: et ts=2 sts=2 sw=2
function! airline#fragments#paste() function! airline#parts#paste()
return g:airline_detect_paste && &paste ? ' '.g:airline_symbols.paste : '' return g:airline_detect_paste && &paste ? ' '.g:airline_symbols.paste : ''
endfunction endfunction
function! airline#fragments#iminsert() function! airline#parts#iminsert()
if g:airline_detect_iminsert && &iminsert && exists('b:keymap_name') if g:airline_detect_iminsert && &iminsert && exists('b:keymap_name')
return ' '.g:airline_left_alt_sep.' '.toupper(b:keymap_name) return ' '.g:airline_left_alt_sep.' '.toupper(b:keymap_name)
endif endif
return '' return ''
endfunction endfunction
function! airline#fragments#readonly() function! airline#parts#readonly()
return &readonly ? g:airline_symbols.readonly : '' return &readonly ? g:airline_symbols.readonly : ''
endfunction endfunction

View File

@ -37,12 +37,12 @@ call extend(g:airline_symbols, {
\ 'branch': get(g:, 'airline_branch_prefix', get(g:, 'airline_powerline_fonts', 0) ? '' : ''), \ 'branch': get(g:, 'airline_branch_prefix', get(g:, 'airline_powerline_fonts', 0) ? '' : ''),
\ }, 'keep') \ }, 'keep')
call s:check_defined('g:airline_fragments', {}) call s:check_defined('g:airline_parts', {})
call extend(g:airline_fragments, { call extend(g:airline_parts, {
\ 'mode': '%{get(w:,"airline_current_mode","")}', \ 'mode': '%{get(w:,"airline_current_mode","")}',
\ 'iminsert': '%{airline#fragments#iminsert()}', \ 'iminsert': '%{airline#parts#iminsert()}',
\ 'paste': '%{airline#fragments#paste()}', \ 'paste': '%{airline#parts#paste()}',
\ 'readonly': '%{airline#fragments#readonly()}', \ 'readonly': '%#airline_file#%{airline#parts#readonly()}',
\ }, 'keep') \ }, 'keep')
call s:check_defined('g:airline_mode_map', {}) call s:check_defined('g:airline_mode_map', {})
@ -68,10 +68,10 @@ call extend(g:airline_theme_map, {
\ '.*solarized.*': 'solarized', \ '.*solarized.*': 'solarized',
\ }, 'keep') \ }, 'keep')
call s:check_defined('g:airline_section_a', (g:airline_fragments.mode).(g:airline_fragments.paste).(g:airline_fragments.iminsert)) 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_b', '')
call s:check_defined('g:airline_section_c', '%f%m') call s:check_defined('g:airline_section_c', '%f%m')
call s:check_defined('g:airline_section_gutter', '%#airline_file#'.(g:airline_fragments.readonly).'%=') call s:check_defined('g:airline_section_gutter', ' '.(g:airline_parts.readonly).'%=')
call s:check_defined('g:airline_section_x', "%{strlen(&filetype)>0?&filetype:''}") call s:check_defined('g:airline_section_x', "%{strlen(&filetype)>0?&filetype:''}")
call s:check_defined('g:airline_section_y', "%{strlen(&fenc)>0?&fenc:''}%{strlen(&ff)>0?'['.&ff.']':''}") call s:check_defined('g:airline_section_y', "%{strlen(&fenc)>0?&fenc:''}%{strlen(&ff)>0?'['.&ff.']':''}")
call s:check_defined('g:airline_section_z', '%3p%% %{g:airline_symbols.linenr} %3l:%3c') call s:check_defined('g:airline_section_z', '%3p%% %{g:airline_symbols.linenr} %3l:%3c')