Finally fix issues with tab detection, #541

This commit is contained in:
Adam Stankiewicz
2020-09-09 19:08:17 +02:00
parent 0ff5d451b0
commit 4f7a4036eb

View File

@@ -1872,13 +1872,13 @@ if !has_key(s:disabled_packages, 'autoindent')
if line[0] == "\t"
setlocal noexpandtab
let &shiftwidth=&tabstop
let b:sleuth_culprit .= ':' . i
return 1
elseif line[0] == " "
let indent = len(matchstr(line, '^ *'))
if (indent % 2 == 0 || indent % 3 == 0) && indent < minindent
let minindent = indent
let b:sleuth_culprit .= ':' . i
endif
endif
endfor
@@ -1886,6 +1886,7 @@ if !has_key(s:disabled_packages, 'autoindent')
if minindent < 10
setlocal expandtab
let &shiftwidth=minindent
let b:sleuth_culprit .= ':' . i
return 1
endif
@@ -1971,6 +1972,9 @@ endfunc
autocmd VimEnter * call s:verify()
set sw=3
set ts=8
" restore Vi compatibility settings
let &cpo = s:cpo_save
unlet s:cpo_save