mirror of
https://github.com/vim-airline/vim-airline.git
synced 2024-11-22 09:58:29 +08:00
Allow overriding trailing ws regexp per buffer
For example, in a github repository, you might want to allow trailing double spaces in a file, but not elsewhere
This commit is contained in:
parent
b861f9d248
commit
0f3feca572
|
@ -78,7 +78,8 @@ function! airline#extensions#whitespace#check()
|
|||
let check = 'trailing'
|
||||
if index(checks, check) > -1 && index(get(skip_check_ft, &ft, []), check) < 0
|
||||
try
|
||||
let regexp = get(g:, 'airline#extensions#whitespace#trailing_regexp', '\s$')
|
||||
let regexp = get(b:, 'airline_whitespace_trailing_regexp',
|
||||
\ get(g:, 'airline#extensions#whitespace#trailing_regexp', '\s$'))
|
||||
let trailing = search(regexp, 'nw')
|
||||
catch
|
||||
call airline#util#warning(printf('Whitespace: error occurred evaluating "%s"', regexp))
|
||||
|
|
|
@ -1558,6 +1558,9 @@ vista.vim <https://github.com/liuchengxu/vista.vim>
|
|||
* configure custom trailing whitespace regexp rule >
|
||||
let g:airline#extensions#whitespace#trailing_regexp = '\s$'
|
||||
|
||||
" this can also be configured for an individual buffer
|
||||
let b:airline_whitespace_trailing_regexp = '\s$'
|
||||
|
||||
* configure, which filetypes have special treatment of /* */ comments,
|
||||
matters for mix-indent-file algorithm: >
|
||||
let airline#extensions#c_like_langs =
|
||||
|
|
Loading…
Reference in New Issue
Block a user