Skip to content

Commit e2f96de

Browse files
committed
Experimental: Support "vimfiles" subdirectory
In hindsight, I think dumping runtime files and directories directly into the root of the repository was a mistake, as it mixes them in with cruft like .gitignore and the README, not to mention not to mention unrelated files in repos with a purpose other than just Vim runtime files. Admittedly, transitioning to an alternate structure at this late stage is unlikely, but I'm adding preliminary support for it anyways as a hedge. The name "vimfiles" is used by Vim itself in a few places and in my opinion is the only name worth considering. I think enabling plugins to choose their own subdirectory would just add unnecessary configuration and overhead.
1 parent a6004fd commit e2f96de

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

autoload/pathogen.vim

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,16 +178,18 @@ function! pathogen#expand(pattern, ...) abort
178178
let found = map(split(pat, ',', 1), 'pre.v:val.post')
179179
let results = []
180180
for pattern in found
181-
call extend(results, call('pathogen#expand', [pattern] + a:000))
181+
call extend(results, pathogen#expand(pattern))
182182
endfor
183183
elseif a:pattern =~# '{}'
184184
let pat = matchstr(a:pattern.after, '^.*{}[^*]*\%($\|[\\/]\)')
185-
let post = (a:pattern.after)[strlen(pat) : -1]
185+
let post = a:pattern[strlen(pat) : -1]
186186
let results = map(split(glob(substitute(pat, '{}', '*', 'g')), "\n"), 'v:val.post')
187187
else
188-
let results = [a:pattern.after]
188+
let results = [a:pattern]
189189
endif
190-
return results
190+
let vf = pathogen#slash() . 'vimfiles'
191+
call map(results, 'v:val =~# "\\*" ? v:val.after : isdirectory(v:val.vf.after) ? v:val.vf.after : isdirectory(v:val.after) ? v:val.after : ""')
192+
return filter(results, '!empty(v:val)')
191193
endfunction
192194

193195
" \ on Windows unless shellslash is set, / everywhere else.

0 commit comments

Comments
 (0)