From 1db6dbed3fd8f236bf6c5525aa0d5976ebd54234 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Tue, 15 Jan 2013 19:02:10 -0500 Subject: [PATCH] Cache executable('zipinfo') for speed on Windows Closes #36. --- plugin/foreplay.vim | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugin/foreplay.vim b/plugin/foreplay.vim index c31e4f8..741cf14 100644 --- a/plugin/foreplay.vim +++ b/plugin/foreplay.vim @@ -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 []