mirror of
https://github.com/sheerun/vim-polyglot.git
synced 2025-11-08 11:33:52 -05:00
Count only increments in indent, also respect ftplugin settings
This commit is contained in:
@@ -2733,7 +2733,7 @@ if !has_key(s:disabled_packages, 'autoindent')
|
|||||||
else
|
else
|
||||||
let spaces_minus_tabs += 1
|
let spaces_minus_tabs += 1
|
||||||
let indent = len(matchstr(line, '^ *'))
|
let indent = len(matchstr(line, '^ *'))
|
||||||
let indent_inc = abs(indent - prev_indent)
|
let indent_inc = indent - prev_indent
|
||||||
|
|
||||||
if indent_inc > 0 && lineno == next_indent_lineno
|
if indent_inc > 0 && lineno == next_indent_lineno
|
||||||
if has_key(indents, indent_inc)
|
if has_key(indents, indent_inc)
|
||||||
@@ -2771,14 +2771,9 @@ if !has_key(s:disabled_packages, 'autoindent')
|
|||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if &expandtab
|
" Do not autodetect indent if language sets it
|
||||||
" Make tabstop to be synchronized with shiftwidth by default
|
if &l:shiftwidth != &g:shiftwidth
|
||||||
" Some plugins are using &shiftwidth directly or accessing &tabstop
|
return
|
||||||
if &tabstop != 8 || &shiftwidth == 0
|
|
||||||
let &shiftwidth = &tabstop
|
|
||||||
else
|
|
||||||
let &tabstop = &shiftwidth
|
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let b:sleuth_culprit = expand("<afile>:p")
|
let b:sleuth_culprit = expand("<afile>:p")
|
||||||
|
|||||||
Reference in New Issue
Block a user