diff --git a/lib/nerdtree/tree_dir_node.vim b/lib/nerdtree/tree_dir_node.vim index 6ed1ea8..7edc50f 100644 --- a/lib/nerdtree/tree_dir_node.vim +++ b/lib/nerdtree/tree_dir_node.vim @@ -278,6 +278,10 @@ function! s:TreeDirNode._glob(pattern, all) else 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()". if nerdtree#runningWindows() && l:pathSpec[0] == nerdtree#slash() let l:pathSpec = self.path.drive . l:pathSpec