redefine ffenc as a function (#235).

This commit is contained in:
Bailey Ling 2013-09-07 18:14:41 +00:00
parent dbd9121c05
commit 697e08a83c
2 changed files with 5 additions and 1 deletions

View File

@ -67,7 +67,7 @@ function! airline#init#bootstrap()
\ 'highlight': 'airline_file', \ 'highlight': 'airline_file',
\ }) \ })
call airline#parts#define_raw('file', '%f%m') call airline#parts#define_raw('file', '%f%m')
call airline#parts#define_raw('ffenc', '%{printf("%s%s",&fenc,strlen(&ff)>0?"[".&ff."]":"")}') call airline#parts#define_function('ffenc', 'airline#parts#ffenc')
call airline#parts#define_empty(['hunks', 'branch', 'tagbar', 'syntastic', 'whitespace']) call airline#parts#define_empty(['hunks', 'branch', 'tagbar', 'syntastic', 'whitespace'])
endfunction endfunction

View File

@ -61,3 +61,7 @@ function! airline#parts#filetype()
return &filetype return &filetype
endfunction endfunction
function! airline#parts#ffenc()
return printf('%s%s', &fenc, strlen(&ff) > 0 ? '['.&ff.']' : '')
endfunction