diff --git a/plugin/NERD_tree.vim b/plugin/NERD_tree.vim index 1171028..e842e61 100644 --- a/plugin/NERD_tree.vim +++ b/plugin/NERD_tree.vim @@ -1539,12 +1539,21 @@ endfunction "Return: the string for this path that is suitable to be used with the :edit "command function! s:Path.strForEditCmd() + let p = self.str(1) + let cwd = getcwd() + if s:running_windows - return self.strForOS(0) - else - return self.str(1) + let p = tolower(self.strForOS(0)) + let cwd = tolower(getcwd()) endif + "return a relative path if we can + if stridx(p, cwd) == 0 + let p = strpart(p, strlen(cwd)+1) + endif + + return p + endfunction "FUNCTION: Path.strForGlob() {{{3 function! s:Path.strForGlob()