add commandt support. resolves #92.

This commit is contained in:
Bailey Ling 2013-07-25 21:54:49 +00:00
parent 950eb41ab6
commit 8819ab272d
2 changed files with 21 additions and 12 deletions

View File

@ -1,6 +1,6 @@
let s:sections = ['a','b','c','gutter','x','y','z'] let s:sections = ['a','b','c','gutter','x','y','z']
function! s:override_left_only(section1, section2) function! airline#extensions#apply_left_override(section1, section2)
let w:airline_section_a = a:section1 let w:airline_section_a = a:section1
let w:airline_section_b = a:section2 let w:airline_section_b = a:section2
let w:airline_section_c = '' let w:airline_section_c = ''
@ -19,7 +19,7 @@ function! airline#extensions#apply_window_overrides()
let w:airline_section_c = '' let w:airline_section_c = ''
let w:airline_section_x = '' let w:airline_section_x = ''
elseif &buftype == 'help' elseif &buftype == 'help'
call s:override_left_only('Help', '%f') call airline#extensions#apply_left_override('Help', '%f')
let w:airline_section_gutter = ' ' let w:airline_section_gutter = ' '
endif endif
@ -30,25 +30,25 @@ function! airline#extensions#apply_window_overrides()
endif endif
if &ft == 'netrw' if &ft == 'netrw'
call s:override_left_only('netrw', '%f') call airline#extensions#apply_left_override('netrw', '%f')
elseif &ft == 'unite' elseif &ft == 'unite'
call s:override_left_only('Unite', '%{unite#get_status_string()}') call airline#extensions#apply_left_override('Unite', '%{unite#get_status_string()}')
elseif &ft == 'nerdtree' elseif &ft == 'nerdtree'
call s:override_left_only('NERD', '') call airline#extensions#apply_left_override('NERD', '')
elseif &ft == 'undotree' elseif &ft == 'undotree'
call s:override_left_only('undotree', '') call airline#extensions#apply_left_override('undotree', '')
elseif &ft == 'gundo' elseif &ft == 'gundo'
call s:override_left_only('Gundo', '') call airline#extensions#apply_left_override('Gundo', '')
elseif &ft == 'diff' elseif &ft == 'diff'
call s:override_left_only('diff', '') call airline#extensions#apply_left_override('diff', '')
elseif &ft == 'tagbar' elseif &ft == 'tagbar'
call s:override_left_only('Tagbar', '') call airline#extensions#apply_left_override('Tagbar', '')
elseif &ft == 'vimshell' elseif &ft == 'vimshell'
call s:override_left_only('vimshell', '%{vimshell#get_status_string()}') call airline#extensions#apply_left_override('vimshell', '%{vimshell#get_status_string()}')
elseif &ft == 'vimfiler' elseif &ft == 'vimfiler'
call s:override_left_only('vimfiler', '%{vimfiler#get_status_string()}') call airline#extensions#apply_left_override('vimfiler', '%{vimfiler#get_status_string()}')
elseif &ft == 'minibufexpl' elseif &ft == 'minibufexpl'
call s:override_left_only('MiniBufExplorer', '') call airline#extensions#apply_left_override('MiniBufExplorer', '')
endif endif
for Fn in g:airline_window_override_funcrefs for Fn in g:airline_window_override_funcrefs
@ -68,6 +68,10 @@ function! airline#extensions#load()
\ } \ }
endif endif
if get(g:, 'command_t_loaded', 0)
call add(g:airline_window_override_funcrefs, function('airline#extensions#commandt#apply_window_override'))
endif
if g:airline_enable_bufferline && get(g:, 'loaded_bufferline', 0) if g:airline_enable_bufferline && get(g:, 'loaded_bufferline', 0)
highlight AlBl_active gui=bold cterm=bold term=bold highlight AlBl_active gui=bold cterm=bold term=bold
highlight link AlBl_inactive Al6 highlight link AlBl_inactive Al6

View File

@ -0,0 +1,5 @@
function! airline#extensions#commandt#apply_window_override()
if bufname('%') ==# 'GoToFile'
call airline#extensions#apply_left_override('CommandT', '')
endif
endfunction