mirror of
https://github.com/sheerun/vim-polyglot.git
synced 2025-11-10 12:33:51 -05:00
Fix disabling autoindent, closes #541
This commit is contained in:
@@ -1777,20 +1777,17 @@ au BufNewFile,BufRead,StdinReadPost *
|
||||
\ | call polyglot#Heuristics() | endif
|
||||
|
||||
|
||||
if v:version < 700 || &cp
|
||||
finish
|
||||
endif
|
||||
if !has_key(s:disabled_packages, 'helm')
|
||||
|
||||
" Code below re-implements sleuth for vim-polyglot
|
||||
let g:loaded_sleuth = 1
|
||||
|
||||
" Code below re-implements sleuth for vim-polyglot
|
||||
let g:loaded_sleuth = 1
|
||||
|
||||
" Makes shiftwidth to be synchronized with tabstop by default
|
||||
if &shiftwidth == &tabstop
|
||||
" Makes shiftwidth to be synchronized with tabstop by default
|
||||
if &shiftwidth == &tabstop
|
||||
let &shiftwidth = 0
|
||||
endif
|
||||
endif
|
||||
|
||||
function! s:guess(lines) abort
|
||||
function! s:guess(lines) abort
|
||||
let options = {}
|
||||
let ccomment = 0
|
||||
let podcomment = 0
|
||||
@@ -1886,9 +1883,9 @@ function! s:guess(lines) abort
|
||||
endif
|
||||
|
||||
return 0
|
||||
endfunction
|
||||
endfunction
|
||||
|
||||
function! s:detect_indent() abort
|
||||
function! s:detect_indent() abort
|
||||
if &buftype ==# 'help'
|
||||
return
|
||||
endif
|
||||
@@ -1923,14 +1920,15 @@ function! s:detect_indent() abort
|
||||
let dir = fnamemodify(dir, ':h')
|
||||
let level -= 1
|
||||
endwhile
|
||||
endfunction
|
||||
endfunction
|
||||
|
||||
setglobal smarttab
|
||||
setglobal smarttab
|
||||
|
||||
augroup polyglot
|
||||
augroup polyglot
|
||||
autocmd!
|
||||
autocmd FileType * call s:detect_indent()
|
||||
augroup END
|
||||
augroup END
|
||||
endif
|
||||
|
||||
" restore Vi compatibility settings
|
||||
let &cpo = s:cpo_save
|
||||
|
||||
Reference in New Issue
Block a user