mirror of
https://github.com/preservim/nerdtree.git
synced 2025-11-08 11:23:48 -05:00
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.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user