summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2020-09-09 17:50:40 +0200
committerAdam Stankiewicz <sheerun@sher.pl>2020-09-09 17:50:40 +0200
commit46affb6153698d9b5678fdb59b5921ffd53aff13 (patch)
treef9652715bc177c5b82585cf4f49698b3b20a40a6
parenta4cc3f64f98e71373e5ee9e566cde17bee723b63 (diff)
downloadvim-polyglot-4.9.5.tar.gz
vim-polyglot-4.9.5.zip
Show warning if g:polyglot_disabled is not at the top of .vimrcv4.9.5
-rw-r--r--ftdetect/polyglot.vim16
1 files changed, 16 insertions, 0 deletions
diff --git a/ftdetect/polyglot.vim b/ftdetect/polyglot.vim
index c5a47471..37a2525e 100644
--- a/ftdetect/polyglot.vim
+++ b/ftdetect/polyglot.vim
@@ -13,6 +13,8 @@ if exists('g:polyglot_disabled')
for pkg in g:polyglot_disabled
let s:disabled_packages[pkg] = 1
endfor
+else
+ let g:polyglot_disabled_not_set = 1
endif
function! s:SetDefault(name, value)
@@ -1948,6 +1950,20 @@ if !has_key(s:disabled_packages, 'autoindent')
command! -bar -bang Sleuth call s:detect_indent()
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
let &cpo = s:cpo_save
unlet s:cpo_save