mirror of
https://github.com/preservim/nerdtree.git
synced 2025-11-08 11:23:48 -05: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:
committed by
Martin Grenfell
parent
89cfedd39b
commit
a3b05e8e38
@@ -2013,7 +2013,12 @@ endfunction
|
|||||||
"Return:
|
"Return:
|
||||||
"a new Path object
|
"a new Path object
|
||||||
function! s:Path.getParent()
|
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)
|
return s:Path.New(path)
|
||||||
endfunction
|
endfunction
|
||||||
"FUNCTION: Path.getLastPathComponent(dirSlash) {{{3
|
"FUNCTION: Path.getLastPathComponent(dirSlash) {{{3
|
||||||
|
|||||||
Reference in New Issue
Block a user