commit 4337022524ff8cfc8918e4c0b3e0f5c192136792
parent 3be5f5ddd86d27ecf364add831c1d60f4b4ef984
Author: Martin Grenfell <martin.grenfell@gmail.com>
Date: Thu, 5 Jan 2012 08:24:15 +0000
dont convert windows paths to lower case when :editing
This fixes #89.
Diffstat:
1 file changed, 8 insertions(+), 11 deletions(-)
diff --git a/plugin/NERD_tree.vim b/plugin/NERD_tree.vim
@@ -2522,20 +2522,18 @@ endfunction
"Return: the string for this path that is suitable to be used with the :edit
"command
function! s:Path._strForEdit()
- let p = self.str({'format': 'UI'})
- let cwd = getcwd()
+ let p = escape(self.str({'format': 'UI'}), s:escape_chars)
+ let cwd = getcwd() . s:Path.Slash()
+ "return a relative path if we can
+ let isRelative = 0
if s:running_windows
- let p = tolower(self.str())
- let cwd = tolower(getcwd())
+ let isRelative = stridx(tolower(p), tolower(cwd)) == 0
+ else
+ let isRelative = stridx(p, cwd) == 0
endif
- let p = escape(p, s:escape_chars)
-
- let cwd = cwd . s:Path.Slash()
-
- "return a relative path if we can
- if stridx(p, cwd) ==# 0
+ if isRelative
let p = strpart(p, strlen(cwd))
"handle the edge case where the file begins with a + (vim interprets
@@ -2550,7 +2548,6 @@ function! s:Path._strForEdit()
endif
return p
-
endfunction
"FUNCTION: Path._strForGlob() {{{3
function! s:Path._strForGlob()