Permalink
Browse files

dont convert windows paths to lower case when :editing

This fixes #89.
  • Loading branch information...
1 parent 3be5f5d commit 4337022524ff8cfc8918e4c0b3e0f5c192136792 @scrooloose committed Jan 5, 2012
Showing with 8 additions and 11 deletions.
  1. +8 −11 plugin/NERD_tree.vim
View
@@ -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
mixvin
mixvin Feb 9, 2013 Contributor

This change has caused the issue #164

When s:running_windows is true, "p" was overriding by self.str() - path with drive letter

+ 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()

0 comments on commit 4337022

Please sign in to comment.