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.
This commit is contained in:
Jason Franklin 2017-08-11 08:46:41 -04:00
parent 1a121337dd
commit b5e54d255e

View File

@ -705,10 +705,10 @@ function! s:Path._strForUI()
endfunction endfunction
" FUNCTION: Path._strForCd() {{{1 " FUNCTION: Path._strForCd() {{{1
" " Return a string representation of this Path that is suitable for use as an
" returns a string that can be used with :cd " argument to Vim's internal ":cd" command.
function! s:Path._strForCd() function! s:Path._strForCd()
return escape(self.str(), self._escChars()) return fnameescape(self.str())
endfunction endfunction
" FUNCTION: Path._strForEdit() {{{1 " FUNCTION: Path._strForEdit() {{{1