allow to also disable trailing whitespace check per filetype

This commit is contained in:
iroedius 2018-04-28 07:34:59 +02:00
parent 33310c5b24
commit 15bc732df4

View File

@ -61,7 +61,8 @@ function! airline#extensions#whitespace#check()
let checks = get(b:, 'airline_whitespace_checks', get(g:, 'airline#extensions#whitespace#checks', s:default_checks)) let checks = get(b:, 'airline_whitespace_checks', get(g:, 'airline#extensions#whitespace#checks', s:default_checks))
let trailing = 0 let trailing = 0
if index(checks, 'trailing') > -1 let check = 'trailing'
if index(checks, check) > -1 && index(get(skip_check_ft, &ft, []), check) < 0
try try
let regexp = get(g:, 'airline#extensions#whitespace#trailing_regexp', '\s$') let regexp = get(g:, 'airline#extensions#whitespace#trailing_regexp', '\s$')
let trailing = search(regexp, 'nw') let trailing = search(regexp, 'nw')