From e6ca2ac58d41dd5a1f19d4907d3140a740e00d42 Mon Sep 17 00:00:00 2001 From: Emil Renner Berthing Date: Tue, 14 Apr 2015 19:01:08 +0200 Subject: [PATCH] whitespace: add more lenient mixed whitespace algorithm --- autoload/airline/extensions/whitespace.vim | 2 ++ doc/airline.txt | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/autoload/airline/extensions/whitespace.vim b/autoload/airline/extensions/whitespace.vim index f7b63b2..10467cd 100644 --- a/autoload/airline/extensions/whitespace.vim +++ b/autoload/airline/extensions/whitespace.vim @@ -30,6 +30,8 @@ function! s:check_mixed_indent() " count of spaces at the end of tabs should be less then tabstop value let t_l_s = '(^\t+ {' . &ts . ',}' . '\S)' return search('\v' . t_s_t . '|' . t_l_s, 'nw') + elseif s:indent_algo == 2 + return search('\v(^\t* +\t\s*\S)', 'nw') else return search('\v(^\t+ +)|(^ +\t+)', 'nw') endif diff --git a/doc/airline.txt b/doc/airline.txt index aa77a46..74c0405 100644 --- a/doc/airline.txt +++ b/doc/airline.txt @@ -407,6 +407,11 @@ eclim " certain number of spaces are allowed after tabs, but not in between " this algorithm works well for /** */ style comments in a tab-indented file let g:airline#extensions#whitespace#mixed_indent_algo = 1 + + " spaces are allowed after tabs, but not in between + " this algorithm works well with programming styles that use tabs for + " indentation and spaces for alignment + let g:airline#extensions#whitespace#mixed_indent_algo = 2 < * customize the whitespace symbol. > let g:airline#extensions#whitespace#symbol = '!'