Skip to content

Commit

Permalink
fix: escape directories containing brackets([...]) for globbing (#1359)
Browse files Browse the repository at this point in the history
  • Loading branch information
kai-patel authored Oct 22, 2023
1 parent ea4833d commit 9184ec0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/nerdtree/tree_dir_node.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9184ec0

Please sign in to comment.