From a3b05e8e38cd70151cba626b29eb92abe45617a3 Mon Sep 17 00:00:00 2001 From: Tim Henigan Date: Tue, 8 Sep 2009 22:19:01 +0800 Subject: [PATCH] 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 Signed-off-by: Martin Grenfell --- plugin/NERD_tree.vim | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugin/NERD_tree.vim b/plugin/NERD_tree.vim index dc76484..56d371d 100644 --- a/plugin/NERD_tree.vim +++ b/plugin/NERD_tree.vim @@ -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