mirror of
https://github.com/vim-airline/vim-airline.git
synced 2024-11-22 14:20:15 +08:00
make syntastic use the warning section
This commit is contained in:
parent
7fb9bcf2c9
commit
d2c069b971
|
@ -2,7 +2,7 @@
|
|||
" vim: ts=2 sts=2 sw=2 fdm=indent
|
||||
|
||||
let s:is_win32term = (has('win32') || has('win64')) && !has('gui_running')
|
||||
let s:sections = ['a','b','c','gutter','x','y','z']
|
||||
let s:sections = ['a','b','c','gutter','x','y','z','warning']
|
||||
|
||||
let s:airline_highlight_map = {
|
||||
\ 'mode' : 'Al2',
|
||||
|
@ -105,7 +105,7 @@ function! s:get_statusline(winnr, active)
|
|||
let sl.=a:active ? g:airline_right_sep : g:airline_right_alt_sep
|
||||
let sl.=l:mode_color
|
||||
let sl.=s:get_section(a:winnr, 'z')
|
||||
let sl.='%#Al3#'.s:getwinvar(a:winnr, 'airline_section_warning', '')
|
||||
let sl.='%(%#warningmsg#'.s:getwinvar(a:winnr, 'airline_section_warning', '').'%)'
|
||||
endif
|
||||
return sl
|
||||
endfunction
|
||||
|
|
|
@ -1,8 +1,12 @@
|
|||
" MIT license. Copyright (c) 2013 Bailey Ling.
|
||||
" vim: ts=2 sts=2 sw=2 fdm=indent
|
||||
|
||||
function! airline#extensions#syntastic#init(ext)
|
||||
if g:airline_section_gutter == ''
|
||||
let g:airline_section_gutter = '%#warningmsg#%{SyntasticStatuslineFlag()}'
|
||||
function! airline#extensions#syntastic#apply()
|
||||
if exists('w:airline_active') && w:airline_active
|
||||
let w:airline_section_warning = ' %#warningmsg#%{SyntasticStatuslineFlag()}'
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#syntastic#init(ext)
|
||||
call a:ext.add_statusline_funcref(function('airline#extensions#syntastic#apply'))
|
||||
endfunction
|
||||
|
|
|
@ -10,7 +10,7 @@ function! airline#extensions#whitespace#check()
|
|||
let mixed = search('^ ', 'nw') != 0 && search('^\t', 'nw') != 0
|
||||
|
||||
if trailing || mixed
|
||||
let text = " ".g:airline_whitespace_symbol." "
|
||||
let text = g:airline_whitespace_symbol." "
|
||||
if g:airline_detect_whitespace == 1
|
||||
if trailing
|
||||
let text .= 'trailing '
|
||||
|
|
|
@ -168,11 +168,11 @@ with the usual statusline syntax.
|
|||
let g:airline_section_a (the mode/paste indicator)
|
||||
let g:airline_section_b (the fugitive/lawrencium branch indicator)
|
||||
let g:airline_section_c (bufferline or filename)
|
||||
let g:airline_section_gutter (syntastic, readonly flag)
|
||||
let g:airline_section_gutter
|
||||
let g:airline_section_x (tagbar, filetype)
|
||||
let g:airline_section_y (fileencoding, fileformat)
|
||||
let g:airline_section_z (percentage, line number, column number)
|
||||
let g:airline_section_warning (special section that only appears sometimes)
|
||||
let g:airline_section_warning (syntastic, whitespace)
|
||||
|
||||
" here is an example of how you could replace the branch indicator with
|
||||
" the current working directory, followed by the filename.
|
||||
|
|
Loading…
Reference in New Issue
Block a user