From 19b8dd7b60eb599d64e23c65f6aa6f9e50edbe18 Mon Sep 17 00:00:00 2001 From: Jason Franklin Date: Fri, 11 Aug 2017 09:32:01 -0400 Subject: [PATCH] Add a check for 'shellslash' in "Path.Slash()' Several issues (namely issue #733) report problems with using the NERDTree on Windows when 'shellslash' is set. This commit doesn't solve all of these problems, but it improves the NERDTree's recognition of this setting. --- lib/nerdtree/path.vim | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/lib/nerdtree/path.vim b/lib/nerdtree/path.vim index db40069..1f33e65 100644 --- a/lib/nerdtree/path.vim +++ b/lib/nerdtree/path.vim @@ -536,9 +536,20 @@ function! s:Path.New(path) endfunction " FUNCTION: Path.Slash() {{{1 -" return the slash to use for the current OS +" Return the path separator used by the underlying file system. Special +" consideration is taken for the use of the 'shellslash' option on Windows +" systems. function! s:Path.Slash() - return nerdtree#runningWindows() ? '\' : '/' + + if nerdtree#runningWindows() + if exists('+shellslash') && &shellslash + return '/' + endif + + return '\' + endif + + return '/' endfunction " FUNCTION: Path.Resolve() {{{1