mirror of
https://github.com/preservim/nerdtree.git
synced 2024-11-25 09:05:56 +08:00
fix: escape directories containing brackets([...]) for globbing (#1359)
This commit is contained in:
parent
ea4833da8a
commit
9184ec05bd
|
@ -278,6 +278,10 @@ function! s:TreeDirNode._glob(pattern, all)
|
||||||
else
|
else
|
||||||
let l:pathSpec = escape(fnamemodify(self.path.str({'format': 'Glob'}), ':.'), ',')
|
let l:pathSpec = escape(fnamemodify(self.path.str({'format': 'Glob'}), ':.'), ',')
|
||||||
|
|
||||||
|
if nerdtree#runningWindows()
|
||||||
|
let l:pathSpec = substitute(l:pathSpec, "\\[\\(.*\\]\\)", "[[]\\1", "g")
|
||||||
|
endif
|
||||||
|
|
||||||
" On Windows, the drive letter may be removed by "fnamemodify()".
|
" On Windows, the drive letter may be removed by "fnamemodify()".
|
||||||
if nerdtree#runningWindows() && l:pathSpec[0] == nerdtree#slash()
|
if nerdtree#runningWindows() && l:pathSpec[0] == nerdtree#slash()
|
||||||
let l:pathSpec = self.path.drive . l:pathSpec
|
let l:pathSpec = self.path.drive . l:pathSpec
|
||||||
|
|
Loading…
Reference in New Issue
Block a user