Disable whitespace checking for csv files

In addition, add a time limit of 500 ms for detecting the indent

fixes: #2200
This commit is contained in:
Christian Brabandt 2020-08-12 15:38:26 +02:00
parent 16935cc666
commit 21e47ca5b3
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09

View File

@ -10,7 +10,8 @@ let s:symbol = get(g:, 'airline#extensions#whitespace#symbol', g:airline_symbols
let s:default_checks = ['indent', 'trailing', 'mixed-indent-file', 'conflicts']
let s:enabled = get(g:, 'airline#extensions#whitespace#enabled', 1)
let s:skip_check_ft = {'make': ['indent', 'mixed-indent-file']}
let s:skip_check_ft = {'make': ['indent', 'mixed-indent-file'],
\ 'csv': ['indent', 'mixed-indent-file']}
function! s:check_mixed_indent()
let indent_algo = get(g:, 'airline#extensions#whitespace#mixed_indent_algo', 0)
@ -23,9 +24,9 @@ function! s:check_mixed_indent()
let t_l_s = '(^\t+ {' . &ts . ',}' . '\S)'
return search('\v' . t_s_t . '|' . t_l_s, 'nw')
elseif indent_algo == 2
return search('\v(^\t* +\t\s*\S)', 'nw')
return search('\v(^\t* +\t\s*\S)', 'nw', 0, 500)
else
return search('\v(^\t+ +)|(^ +\t+)', 'nw')
return search('\v(^\t+ +)|(^ +\t+)', 'nw', 0, 500)
endif
endfunction