diff --git a/autoload/airline/extensions/whitespace.vim b/autoload/airline/extensions/whitespace.vim index 414c596..4cf7faf 100644 --- a/autoload/airline/extensions/whitespace.vim +++ b/autoload/airline/extensions/whitespace.vim @@ -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 diff --git a/doc/airline.txt b/doc/airline.txt index 21fb654..51c193d 100644 --- a/doc/airline.txt +++ b/doc/airline.txt @@ -242,6 +242,10 @@ 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