mirror of
https://github.com/tpope/vim-pathogen.git
synced 2026-05-28 00:21:02 +02:00
Prioritize static paths in infect
The arguments to infect are reversed so that the earlier arguments show
up earlier in the load path. This results in a lot of unintuitive
behaviors and I generally consider it to have been a mistake. To
mitigate this, try pulling out the static, absolute paths and applying
them first. You almost always want this, as it enables the expected
nesting in `pathogen#infect('~/Code/vim/', 'bundle/{}')`.
This commit is contained in:
@@ -30,7 +30,11 @@ function! pathogen#infect(...) abort
|
||||
call add(paths, 'pack/{}/start/{}')
|
||||
endif
|
||||
endif
|
||||
for path in paths
|
||||
let static = '^\%([$~\\/]\|\w:[\\/]\)[^{}*]*[\/]$'
|
||||
for path in filter(copy(paths), 'v:val =~# static')
|
||||
call pathogen#surround(path)
|
||||
endfor
|
||||
for path in filter(copy(paths), 'v:val !~# static')
|
||||
if path =~# '^\%({\=[$~\\/]\|{\=\w:[\\/]\).*\%([{}*]\|[\\/]$\)'
|
||||
call pathogen#surround(path)
|
||||
elseif path =~# '^\%([$~\\/]\|\w:[\\/]\)'
|
||||
|
||||
Reference in New Issue
Block a user