mirror of
https://github.com/sheerun/vim-polyglot.git
synced 2025-11-08 11:33:52 -05:00
Compare commits
3 Commits
1dfeac9917
...
69a86be6d7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
69a86be6d7 | ||
|
|
f5393cfee0 | ||
|
|
58e59edd34 |
@@ -2,7 +2,7 @@ This is my top-starred repository on Github, so I've decided to put this ad here
|
|||||||
|
|
||||||
If you work for big corp and seek consulting, please visit following repository: https://github.com/sheerun/consultation
|
If you work for big corp and seek consulting, please visit following repository: https://github.com/sheerun/consultation
|
||||||
|
|
||||||

|
||||||
|
|
||||||
A collection of language packs for Vim.
|
A collection of language packs for Vim.
|
||||||
|
|
||||||
|
|||||||
@@ -3576,23 +3576,23 @@ if exists("did_load_filetypes") && exists("g:polyglot_disabled")
|
|||||||
runtime! extras/filetype.vim
|
runtime! extras/filetype.vim
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let s:runtime = resolve($VIMRUNTIME)
|
func! s:resolve(file) abort
|
||||||
let s:base = resolve(expand('<sfile>:p:h:h:h'))
|
return substitute(resolve(a:file), '\\', '/', 'g')
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
let s:runtime = s:resolve($VIMRUNTIME)
|
||||||
|
let s:base = s:resolve(expand('<sfile>:p:h:h:h'))
|
||||||
|
|
||||||
func! s:process_rtp(rtp)
|
func! s:process_rtp(rtp)
|
||||||
" Remove vim-polyglot from paths and make everything absolute
|
" Remove vim-polyglot from paths and make everything absolute
|
||||||
let rtp = []
|
let rtp = filter(map(copy(a:rtp[1:-2]), '[s:resolve(v:val), v:val]'),
|
||||||
for path in a:rtp[1:-2]
|
\ 'stridx(v:val[0], s:base) != 0')
|
||||||
let abspath = resolve(path)
|
" User's directory is always first
|
||||||
if stridx(abspath, s:base) != 0
|
|
||||||
call add(rtp, abspath)
|
|
||||||
endif
|
|
||||||
endfor
|
|
||||||
let result = [a:rtp[0]]
|
let result = [a:rtp[0]]
|
||||||
" Then all other stuff (until vimruntime)
|
" Then all other stuff (until vimruntime)
|
||||||
let i = 0
|
let i = 0
|
||||||
for path in rtp[0:len(rtp)-1]
|
for [abspath, path] in rtp[0:len(rtp)-1]
|
||||||
if path == s:runtime
|
if abspath == s:runtime
|
||||||
break
|
break
|
||||||
endif
|
endif
|
||||||
call add(result, path)
|
call add(result, path)
|
||||||
@@ -3602,8 +3602,8 @@ func! s:process_rtp(rtp)
|
|||||||
call add(result, s:base)
|
call add(result, s:base)
|
||||||
" Then all other files, until after-files
|
" Then all other files, until after-files
|
||||||
while i < len(rtp)
|
while i < len(rtp)
|
||||||
let path = rtp[i]
|
let [abspath, path] = rtp[i]
|
||||||
if match(path, '[/\\]after$') > -1
|
if match(abspath, '/after$') > -1
|
||||||
break
|
break
|
||||||
endif
|
endif
|
||||||
call add(result, path)
|
call add(result, path)
|
||||||
@@ -3613,7 +3613,7 @@ func! s:process_rtp(rtp)
|
|||||||
call add(result, s:base . '/after')
|
call add(result, s:base . '/after')
|
||||||
" Then all other after paths
|
" Then all other after paths
|
||||||
while i < len(rtp)
|
while i < len(rtp)
|
||||||
let path = rtp[i]
|
let [_, path] = rtp[i]
|
||||||
call add(result, path)
|
call add(result, path)
|
||||||
let i = i + 1
|
let i = i + 1
|
||||||
endwhile
|
endwhile
|
||||||
|
|||||||
Reference in New Issue
Block a user