From 697e08a83cc15980b7d5972d81e780de9c9240ab Mon Sep 17 00:00:00 2001 From: Bailey Ling Date: Sat, 7 Sep 2013 18:14:41 +0000 Subject: [PATCH] redefine ffenc as a function (#235). --- autoload/airline/init.vim | 2 +- autoload/airline/parts.vim | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/autoload/airline/init.vim b/autoload/airline/init.vim index e54829e..a5a5958 100644 --- a/autoload/airline/init.vim +++ b/autoload/airline/init.vim @@ -67,7 +67,7 @@ function! airline#init#bootstrap() \ 'highlight': 'airline_file', \ }) 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']) endfunction diff --git a/autoload/airline/parts.vim b/autoload/airline/parts.vim index 9abbb89..56afc05 100644 --- a/autoload/airline/parts.vim +++ b/autoload/airline/parts.vim @@ -61,3 +61,7 @@ function! airline#parts#filetype() return &filetype endfunction +function! airline#parts#ffenc() + return printf('%s%s', &fenc, strlen(&ff) > 0 ? '['.&ff.']' : '') +endfunction +