From 4f7a4036eb4f4d64fa5f30e55f23fbb0de4680dc Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Wed, 9 Sep 2020 19:08:17 +0200 Subject: Finally fix issues with tab detection, #541 --- ftdetect/polyglot.vim | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'ftdetect') diff --git a/ftdetect/polyglot.vim b/ftdetect/polyglot.vim index c13df516..a7f808e6 100644 --- a/ftdetect/polyglot.vim +++ b/ftdetect/polyglot.vim @@ -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 -- cgit v1.2.3