Cache executable('zipinfo') for speed on Windows

Closes .
This commit is contained in:
Tim Pope 2013-01-15 19:02:10 -05:00
parent 879443c846
commit 1db6dbed3f

View File

@ -26,7 +26,10 @@ endfunction
let s:jar_contents = {}
function! foreplay#jar_contents(path) abort
if !has_key(s:jar_contents, a:path) && executable('zipinfo')
if !exists('s:zipinfo')
let s:zipinfo = executable('zipinfo')
endif
if !has_key(s:jar_contents, a:path) && s:zipinfo
let s:jar_contents[a:path] = split(system('zipinfo -1 '.shellescape(a:path)), "\n")
if v:shell_error
return []