From b5e54d255e8bc2369531e29b3eee46e4f9fb4f32 Mon Sep 17 00:00:00 2001 From: Jason Franklin Date: Fri, 11 Aug 2017 08:46:41 -0400 Subject: [PATCH] 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. --- lib/nerdtree/path.vim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/nerdtree/path.vim b/lib/nerdtree/path.vim index 79dd483..9bd7793 100644 --- 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