Skip to content

Commit 50a394b

Browse files
rzvxadangibson
andauthored
fix: Make NERDTreeFind to handle directory case sensitivity (#1387)
Co-authored-by: Dan Gibson <[email protected]>
1 parent 0cb04e9 commit 50a394b

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

lib/nerdtree/path.vim

+1-1
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@ function! s:Path.isUnder(parent)
549549
return 0
550550
endif
551551
for i in range(0, l:that_count-1)
552-
if self.pathSegments[i] !=# a:parent.pathSegments[i]
552+
if !nerdtree#pathEquals(self.pathSegments[i], a:parent.pathSegments[i])
553553
return 0
554554
endif
555555
endfor

lib/nerdtree/tree_dir_node.vim

+8-2
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,14 @@ function! s:TreeDirNode.findNode(path)
121121
if a:path.equals(self.path)
122122
return self
123123
endif
124-
if stridx(a:path.str(), self.path.str(), 0) ==# -1
125-
return {}
124+
if nerdtree#caseSensitiveFS()
125+
if stridx(a:path.str(), self.path.str(), 0) ==# -1
126+
return {}
127+
endif
128+
else
129+
if stridx(tolower(a:path.str()), tolower(self.path.str()), 0) ==# -1
130+
return {}
131+
endif
126132
endif
127133

128134
if self.path.isDirectory

0 commit comments

Comments
 (0)