nerdtree

A tree explorer plugin for vim.
Index Commits Files Refs
commit 7a2fc6b6b94e8617a6f0ef14a5f1e789fc385213
parent 19b8dd7b60eb599d64e23c65f6aa6f9e50edbe18
Author: Jason Franklin <j_fra@fastmail.us>
Date:   Fri, 11 Aug 2017 09:43:57 -0400

Refactor the "Path._str()" method

This method was using hardcoded values rather than provided
abstractions to do its work. These improvements were necessary.

Diffstat:
Mlib/nerdtree/path.vim | 14++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/lib/nerdtree/path.vim b/lib/nerdtree/path.vim
@@ -762,19 +762,17 @@ function! s:Path._strForGlob()
 endfunction
 
 " FUNCTION: Path._str() {{{1
-"
-" Gets the string path for this path object that is appropriate for the OS.
-" EG, in windows c:\foo\bar
-"    in *nix  /foo/bar
+" Return the absolute pathname associated with this Path object.  The pathname
+" returned is appropriate for the underlying file system.
 function! s:Path._str()
-    let lead = s:Path.Slash()
+    let l:separator = s:Path.Slash()
+    let l:leader = l:separator
 
-    "if we are running windows then slap a drive letter on the front
     if nerdtree#runningWindows()
-        let lead = self.drive . '\'
+        let l:leader = self.drive . l:separator
     endif
 
-    return lead . join(self.pathSegments, s:Path.Slash())
+    return l:leader . join(self.pathSegments, l:separator)
 endfunction
 
 " FUNCTION: Path.strTrunk() {{{1