Fix detecting indentation, closes #590

This commit is contained in:
Adam Stankiewicz
2020-10-17 11:52:39 +02:00
parent 3383046210
commit 6b9625ecd5

View File

@@ -2608,14 +2608,13 @@ au! BufNewFile,BufRead,StdinReadPost * if expand("<afile>:e") == "" |
\ call polyglot#shebang#Detect() | endif \ call polyglot#shebang#Detect() | endif
au BufEnter * if &ft == "" && expand("<afile>:e") == "" | au BufEnter * if &ft == "" && expand("<afile>:e") == "" |
\ call s:Observe('shebang#Detect') | endif \ call s:Observe('shebang#Detect') | endif
augroup END augroup END
if !has_key(s:disabled_packages, 'autoindent') if !has_key(s:disabled_packages, 'autoindent')
" Code below re-implements sleuth for vim-polyglot " Code below re-implements sleuth for vim-polyglot
let g:loaded_sleuth = 1 let g:loaded_sleuth = 1
let g:loaded_foobar = 1
" Makes shiftwidth to be synchronized with tabstop by default " Makes shiftwidth to be synchronized with tabstop by default
if &shiftwidth == &tabstop if &shiftwidth == &tabstop
@@ -2637,7 +2636,7 @@ if !has_key(s:disabled_packages, 'autoindent')
for line in a:lines for line in a:lines
let i += 1 let i += 1
if !len(line) || line =~# '^\W*$' if !len(line) || line =~# '^\S+$'
continue continue
endif endif