mirror of
https://github.com/vim-airline/vim-airline.git
synced 2024-11-25 09:41:33 +08:00
Allow to customize the trailing whitespace regexp
Currently, vim-airline uses hard-coded '\s$' to check for trailing whitespace. However you might want to check for different values. Therefore, set the variable g:airline#extensions#whitespace#trailing_regexp to the required regexp value. closes #663
This commit is contained in:
parent
020ee382dc
commit
453f4b759f
|
@ -49,7 +49,14 @@ function! airline#extensions#whitespace#check()
|
||||||
|
|
||||||
let trailing = 0
|
let trailing = 0
|
||||||
if index(checks, 'trailing') > -1
|
if index(checks, 'trailing') > -1
|
||||||
let trailing = search('\s$', 'nw')
|
try
|
||||||
|
let regexp = get(g:, 'airline#extensions#whitespace#trailing_regexp', '\s$')
|
||||||
|
let trailing = search(regexp, 'nw')
|
||||||
|
catch
|
||||||
|
echomsg 'airline#whitespace: error occured evaluating '. regexp
|
||||||
|
echomsg v:exception
|
||||||
|
return ''
|
||||||
|
endtry
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let mixed = 0
|
let mixed = 0
|
||||||
|
|
|
@ -449,6 +449,9 @@ eclim <https://eclim.org>
|
||||||
let g:airline#extensions#whitespace#trailing_format = 'trailing[%s]'
|
let g:airline#extensions#whitespace#trailing_format = 'trailing[%s]'
|
||||||
let g:airline#extensions#whitespace#mixed_indent_format = 'mixed-indent[%s]'
|
let g:airline#extensions#whitespace#mixed_indent_format = 'mixed-indent[%s]'
|
||||||
let g:airline#extensions#whitespace#long_format = 'long[%s]'
|
let g:airline#extensions#whitespace#long_format = 'long[%s]'
|
||||||
|
|
||||||
|
* configure custom trailing whitespace regexp rule >
|
||||||
|
let g:airline#extensions#whitespace#trailing_regexp = '\s$'
|
||||||
<
|
<
|
||||||
------------------------------------- *airline-tabline*
|
------------------------------------- *airline-tabline*
|
||||||
* enable/disable enhanced tabline. >
|
* enable/disable enhanced tabline. >
|
||||||
|
|
Loading…
Reference in New Issue
Block a user