From f11f871e3989a64b0e53983856f799025b570e94 Mon Sep 17 00:00:00 2001 From: Bailey Ling Date: Sat, 31 Aug 2013 12:07:56 -0400 Subject: [PATCH] redefine mode as a raw part. --- autoload/airline/init.vim | 2 +- autoload/airline/parts.vim | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/autoload/airline/init.vim b/autoload/airline/init.vim index 50551f40..ac9bf5b3 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 39041f8d..02c0c654 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 : ''