redefine mode as a raw part.

This commit is contained in:
Bailey Ling 2013-08-31 12:07:56 -04:00
parent fb711ba9a9
commit f11f871e39
2 changed files with 4 additions and 4 deletions

View File

@ -52,7 +52,7 @@ function! airline#init#bootstrap()
\ 'branch': get(g:, 'airline_branch_prefix', get(g:, 'airline_powerline_fonts', 0) ? '' : ''),
\ }, 'keep')
call airline#parts#define_function('mode', 'airline#parts#mode')
call airline#parts#define_raw('mode', '%{get(w:, "airline_current_mode", "")}')
call airline#parts#define_function('iminsert', 'airline#parts#iminsert')
call airline#parts#define_function('paste', 'airline#parts#paste')
call airline#parts#define('readonly', {

View File

@ -3,6 +3,8 @@
let s:parts = {}
" PUBLIC API {{{
function! airline#parts#define(key, config)
let s:parts[a:key] = get(s:parts, a:key, {})
call extend(s:parts[a:key], a:config)
@ -30,9 +32,7 @@ function! airline#parts#get(key)
return get(s:parts, a:key, {})
endfunction
function! airline#parts#mode()
return get(w:, 'airline_current_mode', '')
endfunction
" }}}
function! airline#parts#paste()
return g:airline_detect_paste && &paste ? g:airline_symbols.paste : ''