Really fix classpath detection on Windows

This commit is contained in:
Tim Pope 2012-12-31 20:29:31 -05:00
parent 8fc624b04e
commit 36bc4baa61

View File

@ -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