commit 96215c5da6c01d1593eb35ad9ea714cb824ce1c6 parent f4c455bc2f2938738c5a6b3f611f86fb853dc463 Author: Martin Grenfell <martin_grenfell@msn.com> Date: Sun, 30 Nov 2008 20:05:54 +1300 use reletive paths for edit commands if possible Diffstat:
| M | plugin/NERD_tree.vim | | | 15 | ++++++++++++--- |
1 file changed, 12 insertions(+), 3 deletions(-) diff --git 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()
