Environment:
- Operating System: Windows 10 Version 1703 (15063.502)
- Vim version
:version: Vi IMProved 8.0 (2016 Sep 12, compiled Nov 6 2006 17:20:44)- NERDTree version
git rev-parse --short HEAD: 8cd17c1NERDTree settings applied in your vimrc, if any:
" nerdtree let NERDTreeWinPos=1 let g:NERDTreeIgnore = ['\~$', '\.pyc$', '\.class$'] nnoremap <leader>n :NERDTreeToggle<CR>
Process:
- create a file tree like this in desktop:
~/Desktop/test(1)/ | +---src/ | | | +--test.md | +---README.md- open README.md by Vim
- open nerdtree, and open test.md in nerdtree
Current Result:
Cannot open file test.md correctly.
Expected Result:
Open test.md correctly.
Optional
Screenshot(s):
This is not a bug on Linux. I'll have to test on Windows before I can confirm it. Thanks for the report.
@lifecrisis I confirmed this in Windows 7. I have no time to look at it now though.
No worries, @PhilRunninger. I believe I found the problem, but I can't test anything until I get back to my Windows machine at work. A fix is forthcoming.
Enjoy the rest of your weekend!
@PhilRunninger and @mzlogin, do you both have 'shellslash' set when you run Vim on Windows? That looks like the setting that could be causing the problem.
The solution will require that the NERDTree adapt properly to the use of that setting.
'shellslash' is not set on my setup. Here is a stacktrace that may help.
NERDTree: CWD is now: c:\Users\prunninger\Desktop\test(1)) was unexpected at this time.
Error detected while processing function NERDTreeFocus[4]..199[2]..200[12]..183[27]..186[7]..150[25]..148[15]..260[4]..NERDTreeGitStatusRefreshListener[2]..NERDTreeGitStatusRe
fresh:
line 16:
E484: Can't open file C:\Users\PRUNNI~1\AppData\Local\Temp\VIoEBE4.tmp
Error detected while processing function NERDTreeFocus[4]..199[2]..200[12]..183[27]..186[7]..150:
line 25:
E171: Missing :endif
Error detected while processing function NERDTreeFocus[4]..199[2]..200:
line 12:
E171: Missing :endif
Error detected while processing function NERDTreeFocus:
line 4:
E171: Missing :endif
Press ENTER or type command to continue
My tree is the same as in the original post:
~/Desktop/test(1)/
+---src/
| +--test.md
+---README.md
My current directory is ~/Desktop/test(1)/, and I just start vim with no arguments. The first invocation of :NERDTreeFocus causes the errors above. NERDTree is at the latest commit: 8cd17c1
@PhilRunninger, I cannot replicate the error you're getting on Windows 10. I can replicate @mzlogin's error if I set 'shellslash' in the same Windows 10 environment.
That's my current status. This may take more effort to fix than I thought. @mzlogin, are you using 'shellslash'?
@lifecrisis, My bad. That stack trace is coming from another plugin - Xuyuanp/nerdtree-git-plugin. I should have seen that right away, but I guess that's what happens when you don't read the error messages. Disabling that plugin fixes the errors I reported, and I can confirm that 'shellslash' seems to be causing @mzlogin's errors as well.
@lifecrisis @PhilRunninger
Yes, I'm using shellslash, and if I unset shellslash, the error will disappear. But I really need shellslash.
The 'shellslash' setting is the cause of probably five to seven currently open issues, so fixing this is a priority. It may take some time, though. Thanks for the report, @mzlogin.
This bug has been confirmed.
When 'shellslash' is set, do either of you have problems with the u mapping? I do. Please confirm if you also have this problem.
With 'shellslash' on, u goes up a directory level, but it doesn't display any child nodes of that new directory.
UPDATE: I have a fix put together that I'll publish this weekend when I think it's done. If it works, it should fix all of the current issues (5 in total) we have that are related to 'shellslash'.
Thanks for bringing this up, @mzlogin. I may need you to do some testing to ensure that the fix works for you without any side effects, so I'll let you know what branch to fetch from my fork.
ANNOUNCEMENT: Pull request #734 offers a potential fix for this problem. Please checkout the branch there for testing. It must be tested before we merge the changes.
@lifecrisis OK, I will test your branch in working day.
Confirmed, your fix has solved my problem. @lifecrisis Thx.