-
Notifications
You must be signed in to change notification settings - Fork 266
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
NERDTree: square brackets around icon on sourcing vimrc #154
Comments
Thanks for the report. I'll try to debug when I get a chance but it won't be soon sorry |
Thanks Ryan. If there's anything I could do/ places I could look into, I'd be more than happy to help. |
Ah I think I know what this is, see if putting this in your " after a re-source, fix syntax matching issues (concealing brackets):
if exists('g:loaded_webdevicons')
call webdevicons#refresh()
endif I forgot I even had this in my This was also referred to in #71 Also it was added to the readme in the FAQ / Troubleshooting section: 'Issues after re-sourcing vimrc' |
Thanks @ryanoasis. Sorry I didn't make those connections before. Just a minor question: now that I add that code in, upon sourcing vimrc, the NERDTree window collapses all existing directories that were open before. Is this the correct behavior? |
Good point, it currently loses what is opened and the cwd. It is correct behavior but I just added and tested something that should do what you want 😄 I'll try to push something to a release branch today (along with something for #153) |
Thank you for being super responsive! Let me know if you need help with testing it or sth. |
Hey not a problem! Thanks for the report, but also letting me know that the refresh was 'too hard'. If you want to help test I just pushed the fixes to 0.8.3 branch let me know! I had some problems with some icons being reset to the default icon when I resourced my Anyway the refresh method should now by default do a 'soft refresh' with the same code in your |
@ryanoasis sorry for the late response. I could verify that a soft refresh on your |
@tnguyen14 Hey no worries 😄 it's all good. As you can see by the way it is now been merged to master |
Can someone explain why this is happening? Why does the "syntax on" command in any buffer cause the brackets to show up? Some commands/plugins toggle the syntax settings, so I don't think its safe to assume the command is not going to be run in a session. |
So the fix for this should be in master now right? Because I'm running 0.8.5, but I'm still encountering this issue. After sourcing the brackets show up in nerdtree. |
@ismay Yeah it is in master. Maybe it is not very clear but you have to add something to your " after a re-source, fix syntax matching issues (concealing brackets):
if exists('g:loaded_webdevicons')
call webdevicons#refresh()
endif this is also in the FAQ |
@cmcginty Hmm interesting point. I see that setting it on/off does reset the brackets to default state but I think that is to be expected ? From help:
So from what I can understand you cannot limit the syntax on/off to the buffer but there are ways: I got some info here: http://stackoverflow.com/questions/11723175/enable-syntax-highlighting-in-vim-on-a-per-buffer-basis But that still resets devicons syntax (and other plugins). another interesting command is: |
Ah ok, I saw that but thought that that was no longer necessary after the fix. Ok, adding it fixes the problem, but does lead to a new one. When resourcing while the cursor is in the nerdtree buffer, I get the following error: Even though I have this in my config (on line 84): if !&readonly
set fileencoding=utf-8
endif Which shouldn't try to set anything for buffers that aren't modifiable if I'm not mistaken. This is probably an error on my part, but I'm not sure where this is going wrong (this error does not occur when the cursor is not in the nerdtree buffer while resourcing btw). |
Oh okay I see your point. Sorry for confusion. Not sure on those errors you are seeing... can you try with a minimal vimrc ? Potentially something specific to neo vim? Your comment got me thinking about the 'fix' being necessary... it looks like it is possible to hook into a Per help:
This could be a future improvement. |
After testing some more I suspect that this is not a devicons issue. I think it has to do with vim trying to set the nerdtree buffer to utf-8, which it can't do because it isn't modifiable. So your fix for the brackets works perfectly. Thanks! |
I too am still having this issue. calling refresh does not fix it UPDATE: I did not have vim compiled with conceal. |
It's working |
Please look at this #154 (comment) |
Remove unnecessary airline_symbols space character code block and added wildmenu option. Added snippet for vim-devicons and NERDTree behaviour, see ryanoasis/vim-devicons#154
For me the solution is to put this at the bottom of .vimrc
|
It's fixed when using combo
|
I tried all the options suggested above but still having this nasty square brackets issue. Do you know what else I can try?
|
Same here, I have tried all the suggestions and nothing worked. Here are some snippets from my
Any help is appreciated. Thanks. |
Whenever I try to source ~/.vimrc file when NERDTree is open, I get square brackets around the file icons like so:
This does not happen when I first start Vim and NERDTree, only when sourcing vimrc after vim has already opened.
The only reference to this problem I found in this repo is #42, but I didn't find any thing helpful there. I filed an issue with NERDTree preservim/nerdtree#557, but was told that this is actually a devicons issue. I also tried to post a question on stackexchange http://vi.stackexchange.com/questions/7932/sourcing-vimrc-file-put-square-brackets-around-file-icons
For reference, here's the link to my vimrc https://github.com/tnguyen14/dotfiles/blob/master/home/.vimrc
Requirements
These items you must provide answers to. Make sure to add all the information needed to understand the bug so that someone can help. If the info is missing we'll add the 'Needs more information' label and may choose to close the issue until there is enough information.
Optional
The text was updated successfully, but these errors were encountered: