mirror of
https://github.com/sheerun/vim-polyglot.git
synced 2025-11-08 11:33:52 -05:00
Preserve loading order of plugins, fixes #608
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
if !polyglot#util#IsEnabled('julia', expand('<sfile>:p'))
|
||||
if !has_key(g:polyglot_is_disabled, 'julia')
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if !polyglot#util#IsEnabled('rst', expand('<sfile>:p'))
|
||||
if !has_key(g:polyglot_is_disabled, 'rst')
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if !polyglot#util#IsEnabled('ada', expand('<sfile>:p'))
|
||||
if !has_key(g:polyglot_is_disabled, 'ada')
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if !polyglot#util#IsEnabled('rust', expand('<sfile>:p'))
|
||||
if !has_key(g:polyglot_is_disabled, 'rust')
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if !polyglot#util#IsEnabled('rust', expand('<sfile>:p'))
|
||||
if !has_key(g:polyglot_is_disabled, 'rust')
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if !polyglot#util#IsEnabled('clojure', expand('<sfile>:p'))
|
||||
if !has_key(g:polyglot_is_disabled, 'clojure')
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if !polyglot#util#IsEnabled('coffee-script', expand('<sfile>:p'))
|
||||
if !has_key(g:polyglot_is_disabled, 'coffee-script')
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if !polyglot#util#IsEnabled('crystal', expand('<sfile>:p'))
|
||||
if !has_key(g:polyglot_is_disabled, 'crystal')
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if !polyglot#util#IsEnabled('crystal', expand('<sfile>:p'))
|
||||
if !has_key(g:polyglot_is_disabled, 'crystal')
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if !polyglot#util#IsEnabled('csv', expand('<sfile>:p'))
|
||||
if !has_key(g:polyglot_is_disabled, 'csv')
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if !polyglot#util#IsEnabled('dart', expand('<sfile>:p'))
|
||||
if !has_key(g:polyglot_is_disabled, 'dart')
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if !polyglot#util#IsEnabled('elixir', expand('<sfile>:p'))
|
||||
if !has_key(g:polyglot_is_disabled, 'elixir')
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if !polyglot#util#IsEnabled('crystal', expand('<sfile>:p'))
|
||||
if !has_key(g:polyglot_is_disabled, 'crystal')
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if !polyglot#util#IsEnabled('elixir', expand('<sfile>:p'))
|
||||
if !has_key(g:polyglot_is_disabled, 'elixir')
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if !polyglot#util#IsEnabled('elixir', expand('<sfile>:p'))
|
||||
if !has_key(g:polyglot_is_disabled, 'elixir')
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if !polyglot#util#IsEnabled('fish', expand('<sfile>:p'))
|
||||
if !has_key(g:polyglot_is_disabled, 'fish')
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if !polyglot#util#IsEnabled('fsharp', expand('<sfile>:p'))
|
||||
if !has_key(g:polyglot_is_disabled, 'fsharp')
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if !polyglot#util#IsEnabled('gitignore', expand('<sfile>:p'))
|
||||
if !has_key(g:polyglot_is_disabled, 'gitignore')
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if !polyglot#util#IsEnabled('go', expand('<sfile>:p'))
|
||||
if !has_key(g:polyglot_is_disabled, 'go')
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if !polyglot#util#IsEnabled('graphql', expand('<sfile>:p'))
|
||||
if !has_key(g:polyglot_is_disabled, 'graphql')
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if !polyglot#util#IsEnabled('html5', expand('<sfile>:p'))
|
||||
if !has_key(g:polyglot_is_disabled, 'html5')
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if !polyglot#util#IsEnabled('jsonnet', expand('<sfile>:p'))
|
||||
if !has_key(g:polyglot_is_disabled, 'jsonnet')
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if !polyglot#util#IsEnabled('jsx', expand('<sfile>:p'))
|
||||
if !has_key(g:polyglot_is_disabled, 'jsx')
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if !polyglot#util#IsEnabled('jsx', expand('<sfile>:p'))
|
||||
if !has_key(g:polyglot_is_disabled, 'jsx')
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if !polyglot#util#IsEnabled('julia', expand('<sfile>:p'))
|
||||
if !has_key(g:polyglot_is_disabled, 'julia')
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if !polyglot#util#IsEnabled('julia', expand('<sfile>:p'))
|
||||
if !has_key(g:polyglot_is_disabled, 'julia')
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if !polyglot#util#IsEnabled('julia', expand('<sfile>:p'))
|
||||
if !has_key(g:polyglot_is_disabled, 'julia')
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if !polyglot#util#IsEnabled('julia', expand('<sfile>:p'))
|
||||
if !has_key(g:polyglot_is_disabled, 'julia')
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if !polyglot#util#IsEnabled('ledger', expand('<sfile>:p'))
|
||||
if !has_key(g:polyglot_is_disabled, 'ledger')
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if !polyglot#util#IsEnabled('nim', expand('<sfile>:p'))
|
||||
if !has_key(g:polyglot_is_disabled, 'nim')
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,64 +0,0 @@
|
||||
" Restore 'cpoptions'
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
let s:disabled_packages = {}
|
||||
let s:new_polyglot_disabled = []
|
||||
|
||||
if exists('g:polyglot_disabled')
|
||||
for pkg in g:polyglot_disabled
|
||||
let base = split(pkg, '\.')
|
||||
if len(base) > 0
|
||||
let s:disabled_packages[pkg] = 1
|
||||
call add(s:new_polyglot_disabled, base[0])
|
||||
endif
|
||||
endfor
|
||||
else
|
||||
let g:polyglot_disabled_not_set = 1
|
||||
endif
|
||||
|
||||
|
||||
let s:base = expand('<sfile>:p:h:h:h')
|
||||
|
||||
func polyglot#util#Filter(idx, val)
|
||||
let val = fnamemodify(a:val . '/', ':p:h')
|
||||
return resolve(val) !=? s:base && stridx(val, $VIMRUNTIME) == -1 && val !~? '[/\\]after$'
|
||||
endfunc
|
||||
|
||||
let s:rtp = join(filter(split(&rtp, ','), function('polyglot#util#Filter')), ',')
|
||||
|
||||
func polyglot#util#IsEnabled(type, file)
|
||||
if a:file != "ftdetect"
|
||||
let file = a:file[len(s:base) + 1:]
|
||||
let files = globpath(s:rtp, file, 1, 1)
|
||||
if !empty(files)
|
||||
exec 'source' files[0]
|
||||
return 0
|
||||
endif
|
||||
endif
|
||||
if a:type == "jsx"
|
||||
return !has_key(s:disabled_packages, "jsx") && !has_key(s:disabled_packages, "javascript")
|
||||
endif
|
||||
return !has_key(s:disabled_packages, a:type)
|
||||
endfunc
|
||||
|
||||
func! polyglot#util#Verify()
|
||||
if exists("g:polyglot_disabled_not_set")
|
||||
if exists("g:polyglot_disabled")
|
||||
echohl WarningMsg
|
||||
echo "vim-polyglot: g:polyglot_disabled should be defined before loading vim-polyglot"
|
||||
echohl None
|
||||
endif
|
||||
|
||||
unlet g:polyglot_disabled_not_set
|
||||
endif
|
||||
endfunc
|
||||
|
||||
" Save polyglot_disabled without postfixes
|
||||
if exists('g:polyglot_disabled')
|
||||
let g:polyglot_disabled = s:new_polyglot_disabled
|
||||
endif
|
||||
|
||||
" Restore 'cpoptions'
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
@@ -1,4 +1,4 @@
|
||||
if !polyglot#util#IsEnabled('pony', expand('<sfile>:p'))
|
||||
if !has_key(g:polyglot_is_disabled, 'pony')
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if !polyglot#util#IsEnabled('puppet', expand('<sfile>:p'))
|
||||
if !has_key(g:polyglot_is_disabled, 'puppet')
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if !polyglot#util#IsEnabled('puppet', expand('<sfile>:p'))
|
||||
if !has_key(g:polyglot_is_disabled, 'puppet')
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if !polyglot#util#IsEnabled('puppet', expand('<sfile>:p'))
|
||||
if !has_key(g:polyglot_is_disabled, 'puppet')
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if !polyglot#util#IsEnabled('python-compiler', expand('<sfile>:p'))
|
||||
if !has_key(g:polyglot_is_disabled, 'python-compiler')
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if !polyglot#util#IsEnabled('requirements', expand('<sfile>:p'))
|
||||
if !has_key(g:polyglot_is_disabled, 'requirements')
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if !polyglot#util#IsEnabled('ruby', expand('<sfile>:p'))
|
||||
if !has_key(g:polyglot_is_disabled, 'ruby')
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if !polyglot#util#IsEnabled('rust', expand('<sfile>:p'))
|
||||
if !has_key(g:polyglot_is_disabled, 'rust')
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if !polyglot#util#IsEnabled('rust', expand('<sfile>:p'))
|
||||
if !has_key(g:polyglot_is_disabled, 'rust')
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if !polyglot#util#IsEnabled('rust', expand('<sfile>:p'))
|
||||
if !has_key(g:polyglot_is_disabled, 'rust')
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if !polyglot#util#IsEnabled('rust', expand('<sfile>:p'))
|
||||
if !has_key(g:polyglot_is_disabled, 'rust')
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if !polyglot#util#IsEnabled('rust', expand('<sfile>:p'))
|
||||
if !has_key(g:polyglot_is_disabled, 'rust')
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if !polyglot#util#IsEnabled('smt2', expand('<sfile>:p'))
|
||||
if !has_key(g:polyglot_is_disabled, 'smt2')
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if !polyglot#util#IsEnabled('terraform', expand('<sfile>:p'))
|
||||
if !has_key(g:polyglot_is_disabled, 'terraform')
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if !polyglot#util#IsEnabled('crystal', expand('<sfile>:p'))
|
||||
if !has_key(g:polyglot_is_disabled, 'crystal')
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if !polyglot#util#IsEnabled('crystal', expand('<sfile>:p'))
|
||||
if !has_key(g:polyglot_is_disabled, 'crystal')
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if !polyglot#util#IsEnabled('crystal', expand('<sfile>:p'))
|
||||
if !has_key(g:polyglot_is_disabled, 'crystal')
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if !polyglot#util#IsEnabled('crystal', expand('<sfile>:p'))
|
||||
if !has_key(g:polyglot_is_disabled, 'crystal')
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if !polyglot#util#IsEnabled('crystal', expand('<sfile>:p'))
|
||||
if !has_key(g:polyglot_is_disabled, 'crystal')
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if !polyglot#util#IsEnabled('crystal', expand('<sfile>:p'))
|
||||
if !has_key(g:polyglot_is_disabled, 'crystal')
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if !polyglot#util#IsEnabled('crystal', expand('<sfile>:p'))
|
||||
if !has_key(g:polyglot_is_disabled, 'crystal')
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if !polyglot#util#IsEnabled('html5', expand('<sfile>:p'))
|
||||
if !has_key(g:polyglot_is_disabled, 'html5')
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if !polyglot#util#IsEnabled('html5', expand('<sfile>:p'))
|
||||
if !has_key(g:polyglot_is_disabled, 'html5')
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if !polyglot#util#IsEnabled('xsd', expand('<sfile>:p'))
|
||||
if !has_key(g:polyglot_is_disabled, 'xsd')
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if !polyglot#util#IsEnabled('zig', expand('<sfile>:p'))
|
||||
if !has_key(g:polyglot_is_disabled, 'zig')
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if !polyglot#util#IsEnabled('zig', expand('<sfile>:p'))
|
||||
if !has_key(g:polyglot_is_disabled, 'zig')
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if !polyglot#util#IsEnabled('zig', expand('<sfile>:p'))
|
||||
if !has_key(g:polyglot_is_disabled, 'zig')
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if !polyglot#util#IsEnabled('zig', expand('<sfile>:p'))
|
||||
if !has_key(g:polyglot_is_disabled, 'zig')
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user