allow g: gutter to be specified, integrate with vimshell, use get() for :w variables
This commit is contained in:
parent
1385667168
commit
6388005c46
|
@ -31,7 +31,6 @@ function! airline#load_theme(name)
|
||||||
let g:airline_theme = a:name
|
let g:airline_theme = a:name
|
||||||
let inactive_colors = g:airline#themes#{g:airline_theme}#inactive "also lazy loads the theme
|
let inactive_colors = g:airline#themes#{g:airline_theme}#inactive "also lazy loads the theme
|
||||||
let w:airline_lastmode = ''
|
let w:airline_lastmode = ''
|
||||||
let w:airline_active = 1
|
|
||||||
call airline#highlight(['inactive'])
|
call airline#highlight(['inactive'])
|
||||||
call airline#update_highlight()
|
call airline#update_highlight()
|
||||||
endfunction
|
endfunction
|
||||||
|
@ -126,8 +125,9 @@ function! airline#update_statusline(active)
|
||||||
let sl.=l:info_sep_color
|
let sl.=l:info_sep_color
|
||||||
let sl.=g:airline_left_sep
|
let sl.=g:airline_left_sep
|
||||||
let sl.=l:status_color.' %<'.s:get_section('c').' '
|
let sl.=l:status_color.' %<'.s:get_section('c').' '
|
||||||
let sl.=exists('w:airline_section_gutter')
|
let gutter = get(w:, 'airline_section_gutter', get(g:, 'airline_section_gutter', ''))
|
||||||
\ ? s:get_section('gutter')
|
let sl.=gutter != ''
|
||||||
|
\ ? gutter
|
||||||
\ : '%#warningmsg#'.g:airline_externals_syntastic.l:file_flag_color."%{&ro ? g:airline_readonly_symbol : ''}".l:status_color
|
\ : '%#warningmsg#'.g:airline_externals_syntastic.l:file_flag_color."%{&ro ? g:airline_readonly_symbol : ''}".l:status_color
|
||||||
else
|
else
|
||||||
let sl.=l:status_color.' %f%m'
|
let sl.=l:status_color.' %f%m'
|
||||||
|
@ -148,7 +148,7 @@ endfunction
|
||||||
|
|
||||||
let g:airline_current_mode_text = ''
|
let g:airline_current_mode_text = ''
|
||||||
function! airline#update_highlight()
|
function! airline#update_highlight()
|
||||||
if w:airline_active
|
if get(w:, 'airline_active', 1)
|
||||||
let l:m = mode()
|
let l:m = mode()
|
||||||
if l:m ==# "i"
|
if l:m ==# "i"
|
||||||
let l:mode = ['insert']
|
let l:mode = ['insert']
|
||||||
|
@ -168,7 +168,7 @@ function! airline#update_highlight()
|
||||||
if &paste | call add(l:mode, 'paste') | endif
|
if &paste | call add(l:mode, 'paste') | endif
|
||||||
|
|
||||||
let mode_string = join(l:mode)
|
let mode_string = join(l:mode)
|
||||||
if !exists('w:airline_lastmode') || w:airline_lastmode != mode_string
|
if get(w:, 'airline_lastmode', '') != mode_string
|
||||||
call airline#highlight(l:mode)
|
call airline#highlight(l:mode)
|
||||||
let w:airline_lastmode = mode_string
|
let w:airline_lastmode = mode_string
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -8,9 +8,9 @@ function! s:override_left_only(section1, section2)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! airline#extensions#clear_window_overrides()
|
function! airline#extensions#clear_window_overrides()
|
||||||
silent! unlet w:airline_left_only
|
unlet! w:airline_left_only
|
||||||
for section in s:sections
|
for section in s:sections
|
||||||
silent! unlet w:airline_section_{section}
|
unlet! w:airline_section_{section}
|
||||||
endfor
|
endfor
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
@ -29,6 +29,8 @@ function! airline#extensions#apply_window_overrides()
|
||||||
call s:override_left_only('diff', '')
|
call s:override_left_only('diff', '')
|
||||||
elseif &ft == 'tagbar'
|
elseif &ft == 'tagbar'
|
||||||
call s:override_left_only('Tagbar', '')
|
call s:override_left_only('Tagbar', '')
|
||||||
|
elseif &ft == 'vimshell'
|
||||||
|
call s:override_left_only('vimshell', vimshell#get_status_string())
|
||||||
elseif &ft == 'minibufexpl'
|
elseif &ft == 'minibufexpl'
|
||||||
call s:override_left_only('MiniBufExplorer', '')
|
call s:override_left_only('MiniBufExplorer', '')
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -121,8 +121,8 @@ separators, as well as the powerline font glyths.
|
||||||
" powerline symbols
|
" powerline symbols
|
||||||
let g:airline_left_sep = ''
|
let g:airline_left_sep = ''
|
||||||
let g:airline_left_alt_sep = ''
|
let g:airline_left_alt_sep = ''
|
||||||
let g:airline_right_sep = ''
|
let g:airline_right_sep = ''
|
||||||
let g:airline_right_alt_sep = ''
|
let g:airline_right_alt_sep = ''
|
||||||
let g:airline_fugitive_prefix = ' '
|
let g:airline_fugitive_prefix = ' '
|
||||||
let g:airline_readonly_symbol = ''
|
let g:airline_readonly_symbol = ''
|
||||||
let g:airline_linecolumn_prefix = ' '
|
let g:airline_linecolumn_prefix = ' '
|
||||||
|
|
Loading…
Reference in New Issue