mirror of
https://github.com/vim-airline/vim-airline-themes.git
synced 2024-12-05 00:13:34 +08:00
support formattable whitespace messages. resolves #185.
This commit is contained in:
parent
6a3b611ba1
commit
358d4328f4
|
@ -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
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue
Block a user