preservim / nerdtree

A tree explorer plugin for vim.
Do What The F*ck You Want To Public License
19.56k stars 1.44k forks source link

Fix [...] directories not showing children #1359

Closed kai-patel closed 11 months ago

kai-patel commented 1 year ago

Description of Changes

Correctly escape directories named [<dir_name>] on Windows. Per :help wildcards:

To avoid the special meaning of the wildcards prepend a backslash.  However,
on MS-Windows the backslash is a path separator and "path\[abc]" is still seen
as a wildcard when "[" is in the 'isfname' option.  A simple way to avoid this
is to use "path\[[]abc]", this matches the file "path\[abc]".

This fix simply implements this pattern for TreeDirNode l:pathSpec, and only on Windows - as I haven't seen any documentation showing this bug on other systems.

Before this change, children of directories with square-bracketed names would not be shown (see issues below for examples).

This is related to, but does not close necessarily vim/vim#12629, neovim/neovim#24233


New Version Info

Author's Instructions