support formattable whitespace messages. resolves #185.

This commit is contained in:
Bailey Ling 2013-08-26 02:08:04 +00:00
parent 6a3b611ba1
commit 358d4328f4
2 changed files with 9 additions and 2 deletions

View File

@ -15,6 +15,9 @@ let s:symbol = get(g:, 'airline#extensions#whitespace#symbol',
let s:checks = get(g:, 'airline#extensions#whitespace#checks', ['indent', 'trailing'])
let s:trailing_format = get(g:, 'airline#extensions#whitespace#trailing_format', 'trailing[%s]')
let s:mixed_indent_format = get(g:, 'airline#extensions#whitespace#mixed_indent_format', 'mixed-indent[%s]')
let s:initialized = 0
let s:enabled = 1
@ -41,11 +44,11 @@ function! airline#extensions#whitespace#check()
let b:airline_whitespace_check = s:symbol." "
if s:show_message
if trailing != 0
let b:airline_whitespace_check .= 'trailing['.trailing.'] '
let b:airline_whitespace_check .= printf(s:trailing_format, trailing).' '
endif
if mixed
let mixnr = indents[0] == indents[1] ? indents[0] : indents[2]
let b:airline_whitespace_check .= 'mixed-indent['.mixnr.'] '
let b:airline_whitespace_check .= printf(s:mixed_indent_format, mixnr).' '
endif
endif
endif

View File

@ -242,6 +242,10 @@ vim-signify <https://github.com/mhinz/vim-signify>
<
* configure whether a message should be displayed. >
let g:airline#extensions#whitespace#show_message = 1
<
* configure the formatting of the warning messages. >
let g:airline#extensions#whitespace#trailing_format = 'trailing[%s]'
let g:airline#extensions#whitespace#mixed_indent_format = 'mixed-indent[%s]'
<
*airline-ctrlp*
ctrlp <https://github.com/kien/ctrlp.vim>