Taught s:Path.getParent to handle Windows paths.

There was an error in the function which prevented Windows paths
from being properly decoded.  This error was causing the ".. (up a dir)"
feature to fail due to an unhandled Invalid Argument exception.

Signed-off-by: Tim Henigan <tim.henigan@gmail.com>

Signed-off-by: Martin Grenfell <martin_grenfell@msn.com>
This commit is contained in:
Tim Henigan 2009-09-08 22:19:01 +08:00 committed by Martin Grenfell
parent 89cfedd39b
commit a3b05e8e38

View File

@ -2013,7 +2013,12 @@ endfunction
"Return:
"a new Path object
function! s:Path.getParent()
let path = '/'. join(self.pathSegments[0:-2], '/')
if s:running_windows
let path = self.drive . '\' . join(self.pathSegments[0:-2], '\')
else
let path = '/'. join(self.pathSegments[0:-2], '/')
endif
return s:Path.New(path)
endfunction
"FUNCTION: Path.getLastPathComponent(dirSlash) {{{3