-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot open file or directory whose name include [ or ] #680
Comments
Confirmed this bug on my installations. |
I believe this is only a problem when the file contains both brackets, with [ followed by ]. I'm not even seeing the file in the NERDTree. #391 may be the same issue. |
Hey, @PhilRunninger! I've isolated the bug to the Essentially, anything that looks like I'm not a regular expression wizard yet. Maybe you can take a look. |
It looks like line 389 is used to remove the flag that git-nerdtree-plugin puts on, but if |
That actually sounds like a good decision for now. It seems more like a temporary fix, because other flags can exist that cause |
I've been hit with this bug and even though I agree that the problem requires a significant change to be rock-solid, but I've found a minimal change that works under the (weak) assumption that flags generally use special characters. Here's the patch, for those interested: diff --git a/lib/nerdtree/ui.vim b/lib/nerdtree/ui.vim
index 196d745..07a87e6 100644
--- a/lib/nerdtree/ui.vim
+++ b/lib/nerdtree/ui.vim
@@ -381,7 +381,7 @@ function! s:UI._stripMarkup(line)
let line = substitute (line, '*\ze\($\| \)', "","")
" strip off any generic flags
- let line = substitute (line, '\[[^]]*\]', "","")
+ let line = substitute (line, '\[\W*\]', "","")
let line = substitute (line,' -> .*',"","") " remove link to
Should you be interested in a PR, I'm just a ping away :) |
@lifecrisis, I'm thinking about a fix for this issue. What if we used a non-breaking space (ASCII code 160) to delimit the filename from the flags and bookmark label? That character is very unlikely to be used in a filename, and parsing the node's text would be a lot easier. I'll work on it, and throw a PR out for review. |
I confirm #868 fixes the issue. Congrats and thanks! |
#868 fixes the issue. thanks! |
Thanks for confirming this for me. I'll close the issue again when I do the merge. |
MacOS 10.12.3
Vim 8.0
scrooloose/nerdtree installed via vundle
The text was updated successfully, but these errors were encountered: