Skip to content

Commit

Permalink
fix: Make NERDTreeFind to handle directory case sensitivity (#1387)
Browse files Browse the repository at this point in the history
Co-authored-by: Dan Gibson <[email protected]>
  • Loading branch information
rzvxa and dangibson authored Dec 1, 2023
1 parent 0cb04e9 commit 50a394b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/nerdtree/path.vim
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ function! s:Path.isUnder(parent)
return 0
endif
for i in range(0, l:that_count-1)
if self.pathSegments[i] !=# a:parent.pathSegments[i]
if !nerdtree#pathEquals(self.pathSegments[i], a:parent.pathSegments[i])
return 0
endif
endfor
Expand Down
10 changes: 8 additions & 2 deletions lib/nerdtree/tree_dir_node.vim
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,14 @@ function! s:TreeDirNode.findNode(path)
if a:path.equals(self.path)
return self
endif
if stridx(a:path.str(), self.path.str(), 0) ==# -1
return {}
if nerdtree#caseSensitiveFS()
if stridx(a:path.str(), self.path.str(), 0) ==# -1
return {}
endif
else
if stridx(tolower(a:path.str()), tolower(self.path.str()), 0) ==# -1
return {}
endif
endif

if self.path.isDirectory
Expand Down

0 comments on commit 50a394b

Please sign in to comment.