mirror of
https://github.com/vim-airline/vim-airline.git
synced 2025-12-16 08:47:16 +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:
@@ -49,7 +49,14 @@ function! airline#extensions#whitespace#check()
|
||||
|
||||
let trailing = 0
|
||||
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
|
||||
|
||||
let mixed = 0
|
||||
|
||||
Reference in New Issue
Block a user