mirror of
https://github.com/vim-airline/vim-airline.git
synced 2025-07-21 13:04:54 +02:00
Merge pull request #1065 from nach/master
extensions#whitespace: fix false positive for check_mix_indent_file()
This commit is contained in:
commit
6c43fdea96
@ -35,8 +35,14 @@ function! s:check_mixed_indent()
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:check_mixed_indent_file()
|
function! s:check_mixed_indent_file()
|
||||||
|
if stridx(&ft, 'c') == 0 || stridx(&ft, 'cpp') == 0
|
||||||
|
" for C/CPP only allow /** */ comment style with one space before the '*'
|
||||||
|
let head_spc = '\v(^ +\*@!)'
|
||||||
|
else
|
||||||
|
let head_spc = '\v(^ +)'
|
||||||
|
endif
|
||||||
let indent_tabs = search('\v(^\t+)', 'nw')
|
let indent_tabs = search('\v(^\t+)', 'nw')
|
||||||
let indent_spc = search('\v(^ +)', 'nw')
|
let indent_spc = search(head_spc, 'nw')
|
||||||
if indent_tabs > 0 && indent_spc > 0
|
if indent_tabs > 0 && indent_spc > 0
|
||||||
return printf("%d:%d", indent_tabs, indent_spc)
|
return printf("%d:%d", indent_tabs, indent_spc)
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user