mirror of
https://github.com/sheerun/vim-polyglot.git
synced 2025-11-09 20:13:51 -05:00
Show warning if g:polyglot_disabled is not at the top of .vimrc
This commit is contained in:
@@ -13,6 +13,8 @@ if exists('g:polyglot_disabled')
|
|||||||
for pkg in g:polyglot_disabled
|
for pkg in g:polyglot_disabled
|
||||||
let s:disabled_packages[pkg] = 1
|
let s:disabled_packages[pkg] = 1
|
||||||
endfor
|
endfor
|
||||||
|
else
|
||||||
|
let g:polyglot_disabled_not_set = 1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
function! s:SetDefault(name, value)
|
function! s:SetDefault(name, value)
|
||||||
@@ -1948,6 +1950,20 @@ if !has_key(s:disabled_packages, 'autoindent')
|
|||||||
command! -bar -bang Sleuth call s:detect_indent()
|
command! -bar -bang Sleuth call s:detect_indent()
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
func! s:verify()
|
||||||
|
if exists("g:polyglot_disabled_not_set")
|
||||||
|
if exists("g:polyglot_disabled")
|
||||||
|
echohl WarningMsg
|
||||||
|
echo "vim-polyglot: g:polyglot_disabled should be at the top of .vimrc"
|
||||||
|
echohl None
|
||||||
|
endif
|
||||||
|
|
||||||
|
unlet g:polyglot_disabled_not_set
|
||||||
|
endif
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
autocmd VimEnter * call s:verify()
|
||||||
|
|
||||||
" restore Vi compatibility settings
|
" restore Vi compatibility settings
|
||||||
let &cpo = s:cpo_save
|
let &cpo = s:cpo_save
|
||||||
unlet s:cpo_save
|
unlet s:cpo_save
|
||||||
|
|||||||
Reference in New Issue
Block a user