mirror of
https://github.com/preservim/nerdtree.git
synced 2025-02-01 01:55:15 +08:00
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:
parent
89cfedd39b
commit
a3b05e8e38
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user