nerdtree

A tree explorer plugin for vim.
Index Commits Files Refs
commit b5e54d255e8bc2369531e29b3eee46e4f9fb4f32
parent 1a121337dd1e8d7ec6c44c068cb147f4e9b896ef
Author: Jason Franklin <j_fra@fastmail.us>
Date:   Fri, 11 Aug 2017 08:46:41 -0400

Rewrite the "Path._strForCd()" method

This commit is the first in a series of commits that will rework
some of the methods responsible for escaping pathnames. Some of
these methods simply don't use the features that Vim has properly.

The custom "Path._escChars()" method is far too rigid for our
purposes, and better options have been available for some time.

See ":h fnameescape()" for an especially helpful function in this
effort.

Diffstat:
Mlib/nerdtree/path.vim | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/nerdtree/path.vim b/lib/nerdtree/path.vim
@@ -705,10 +705,10 @@ function! s:Path._strForUI()
 endfunction
 
 " FUNCTION: Path._strForCd() {{{1
-"
-" returns a string that can be used with :cd
+" Return a string representation of this Path that is suitable for use as an
+" argument to Vim's internal ":cd" command.
 function! s:Path._strForCd()
-    return escape(self.str(), self._escChars())
+    return fnameescape(self.str())
 endfunction
 
 " FUNCTION: Path._strForEdit() {{{1