nerdtree

A tree explorer plugin for vim.
Index Commits Files Refs
commit a3b05e8e38cd70151cba626b29eb92abe45617a3
parent 89cfedd39bf7659518c6f5ee4fcb55dbed522ecf
Author: Tim Henigan <tim.henigan@gmail.com>
Date:   Tue,  8 Sep 2009 22:19:01 +0800

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>
Diffstat:
Mplugin/NERD_tree.vim | 7++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git 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