syntastic: slightly tweak output format

also document how to use different syntastic statusline format

closes #1525
This commit is contained in:
Christian Brabandt 2017-08-08 14:57:04 +02:00
parent 83ceae726e
commit 2ec563bd57
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09
2 changed files with 9 additions and 3 deletions

View File

@ -22,15 +22,15 @@ function! airline#extensions#syntastic#get(type)
let _backup = get(g:, 'syntastic_stl_format', '')
let is_err = (a:type is# 'error')
if is_err
let g:syntastic_stl_format = '%E{%e(L%fe)}'
let g:syntastic_stl_format = get(g:, 'airline#extensions#syntastic#stl_format_err', '%E{[%e(#%fe)]}')
else
let g:syntastic_stl_format = '%W{%w(L%fw)}'
let g:syntastic_stl_format = get(g:, 'airline#extensions#syntastic#stl_format_warn', '%W{[%w(#%fw)]}')
endif
let cnt = SyntasticStatuslineFlag()
if !empty(_backup)
let g:syntastic_stl_format = _backup
endif
if cnt == 0
if empty(cnt)
return ''
else
return (is_err ? s:error_symbol : s:warning_symbol).cnt

View File

@ -456,9 +456,15 @@ syntastic <https://github.com/vim-syntastic/syntastic>
* syntastic error_symbol >
let airline#extensions#syntastic#error_symbol = 'E:'
<
* syntastic statusline error format (see |syntastic_stl_format|) >
let airline#extensions#syntastic#stl_format_err = '%E{]%e(#%fe)]}'
* syntastic warning >
let airline#extensions#syntastic#warning_symbol = 'W:'
<
* syntastic statusline warning format (see |syntastic_stl_format|) >
let airline#extensions#syntastic#stl_format_err = '%W{]%w(#%fw)]}'
<
------------------------------------- *airline-tagbar*
tagbar <https://github.com/majutsushi/tagbar>