From 36bc4baa6176f5a5f2d0270b5e1ab8ea49f0e95e Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Mon, 31 Dec 2012 20:29:31 -0500 Subject: [PATCH] Really fix classpath detection on Windows --- autoload/classpath.vim | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/autoload/classpath.vim b/autoload/classpath.vim index 696ac39..98c91e8 100644 --- a/autoload/classpath.vim +++ b/autoload/classpath.vim @@ -104,7 +104,14 @@ function! classpath#detect(...) abort if &verbose echomsg 'Determining class path with '.cmd.' ...' endif - let out = system('cd ' . shellescape(root) . (&shell =~? 'cmd' ? '; ' : ' && ') . cmd) + let cd = exists('*haslocaldir') && haslocaldir() ? 'lcd ' : 'cd ' + let dir = getcwd() + try + execute cd . fnameescape(root) + let out = system(cmd) + finally + execute cd . fnameescape(dir) + endtry catch /^Vim:Interrupt/ return default endtry