mirror of
https://github.com/sheerun/vim-polyglot.git
synced 2025-11-15 15:03:50 -05:00
Respect shiftwidth if set by user or plugin
This commit is contained in:
@@ -2638,6 +2638,8 @@ if !has_key(s:disabled_packages, 'autoindent')
|
|||||||
let &tabstop = 2
|
let &tabstop = 2
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
let s:default_shiftwidth = &shiftwidth
|
||||||
|
|
||||||
func! s:get_shiftwidth(indents) abort
|
func! s:get_shiftwidth(indents) abort
|
||||||
let shiftwidth = 0
|
let shiftwidth = 0
|
||||||
let max_count = 0
|
let max_count = 0
|
||||||
@@ -2788,8 +2790,8 @@ if !has_key(s:disabled_packages, 'autoindent')
|
|||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Do not autodetect indent if language sets it
|
" Do not autodetect indent if language or user sets it
|
||||||
if &l:shiftwidth != &g:shiftwidth
|
if &l:shiftwidth != s:default_shiftwidth
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user