diff --git a/autoload/airline/init.vim b/autoload/airline/init.vim index 50551f4..ac9bf5b 100644 --- a/autoload/airline/init.vim +++ b/autoload/airline/init.vim @@ -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', { diff --git a/autoload/airline/parts.vim b/autoload/airline/parts.vim index 39041f8..02c0c65 100644 --- a/autoload/airline/parts.vim +++ b/autoload/airline/parts.vim @@ -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 : ''