fix: Make NERDTreeFind to handle directory case sensitivity (#1387)

Co-authored-by: Dan Gibson <danial.gibson@spin.net.au>
This commit is contained in:
Ali Rezvani 2023-12-01 22:42:13 +03:30 committed by GitHub
parent 0cb04e9245
commit 50a394b2bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 3 deletions

View File

@ -549,7 +549,7 @@ function! s:Path.isUnder(parent)
return 0 return 0
endif endif
for i in range(0, l:that_count-1) 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 return 0
endif endif
endfor endfor

View File

@ -121,9 +121,15 @@ function! s:TreeDirNode.findNode(path)
if a:path.equals(self.path) if a:path.equals(self.path)
return self return self
endif endif
if nerdtree#caseSensitiveFS()
if stridx(a:path.str(), self.path.str(), 0) ==# -1 if stridx(a:path.str(), self.path.str(), 0) ==# -1
return {} return {}
endif endif
else
if stridx(tolower(a:path.str()), tolower(self.path.str()), 0) ==# -1
return {}
endif
endif
if self.path.isDirectory if self.path.isDirectory
for i in self.children for i in self.children