Preserve loading order of plugins, fixes #608

This commit is contained in:
Adam Stankiewicz
2020-10-25 20:33:44 +01:00
parent 81ada1101e
commit 45a7512dea
1287 changed files with 1963 additions and 1952 deletions

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('haskell', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'haskell')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('cjsx', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'cjsx')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('haskell', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'haskell')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('html5', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'html5')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('idris', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'idris')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('idris2', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'idris2')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('javascript', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'javascript')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('jsx', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'jsx')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('jsx', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'jsx')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('jsx', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'jsx')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('llvm', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'llvm')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('puppet', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'puppet')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('jsx', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'jsx')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('jsx', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'jsx')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('html5', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'html5')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('jsx', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'jsx')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('graphql', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'graphql')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('jsx', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'jsx')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('jsx', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'jsx')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('objc', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'objc')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('jsx', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'jsx')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('graphql', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'graphql')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('jsx', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'jsx')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('cpp-modern', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'cpp-modern')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('cjsx', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'cjsx')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('cpp-modern', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'cpp-modern')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('dhall', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'dhall')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('scala', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'scala')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('html5', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'html5')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('html5', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'html5')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('html5', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'html5')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('html5', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'html5')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('idris', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'idris')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('idris2', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'idris2')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('jsx', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'jsx')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('graphql', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'graphql')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('html5', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'html5')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('javascript-sql', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'javascript-sql')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('jsx', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'jsx')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('graphql', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'graphql')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('jsx', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'jsx')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('jsx', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'jsx')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('llvm', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'llvm')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('mdx', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'mdx')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('mathematica', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'mathematica')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('objc', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'objc')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('reason', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'reason')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('graphql', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'graphql')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('rspec', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'rspec')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('yard', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'yard')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('rust', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'rust')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('jsx', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'jsx')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('graphql', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'graphql')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('jsx', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'jsx')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('graphql', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'graphql')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('graphql', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'graphql')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('zinit', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'zinit')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('julia', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'julia')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('rst', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'rst')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('ada', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'ada')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('rust', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'rust')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('rust', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'rust')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('clojure', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'clojure')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('coffee-script', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'coffee-script')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('crystal', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'crystal')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('crystal', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'crystal')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('csv', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'csv')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('dart', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'dart')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('elixir', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'elixir')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('crystal', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'crystal')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('elixir', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'elixir')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('elixir', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'elixir')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('fish', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'fish')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('fsharp', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'fsharp')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('gitignore', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'gitignore')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('go', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'go')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('graphql', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'graphql')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('html5', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'html5')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('jsonnet', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'jsonnet')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('jsx', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'jsx')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('jsx', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'jsx')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('julia', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'julia')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('julia', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'julia')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('julia', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'julia')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('julia', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'julia')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('ledger', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'ledger')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('nim', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'nim')
finish
endif

View File

@@ -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

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('pony', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'pony')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('puppet', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'puppet')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('puppet', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'puppet')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('puppet', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'puppet')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('python-compiler', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'python-compiler')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('requirements', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'requirements')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('ruby', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'ruby')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('rust', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'rust')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('rust', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'rust')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('rust', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'rust')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('rust', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'rust')
finish
endif

View File

@@ -1,4 +1,4 @@
if !polyglot#util#IsEnabled('rust', expand('<sfile>:p'))
if !has_key(g:polyglot_is_disabled, 'rust')
finish
endif

Some files were not shown because too many files have changed in this diff Show More