diff --git a/autoload/airline/parts.vim b/autoload/airline/parts.vim index f1b7c00a..e5cbd38e 100644 --- a/autoload/airline/parts.vim +++ b/autoload/airline/parts.vim @@ -30,6 +30,10 @@ function! airline#parts#define_condition(key, predicate) call airline#parts#define(a:key, { 'condition': a:predicate }) endfunction +function! airline#parts#define_accent(key, accent) + call airline#parts#define(a:key, { 'accent': a:accent }) +endfunction + function! airline#parts#define_empty(keys) for key in a:keys call airline#parts#define_raw(key, '') diff --git a/t/parts.vim b/t/parts.vim index ba4341d7..ee7c92e3 100644 --- a/t/parts.vim +++ b/t/parts.vim @@ -30,5 +30,10 @@ describe 'parts' call airline#parts#define_condition('part', '1') Expect airline#parts#get('part').condition == '1' end + + it 'can define a accent' + call airline#parts#define_accent('part', 'red') + Expect airline#parts#get('part').accent == 'red' + end end