Skip to content
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

Race condition with NERDtree when opening vim with a directory argument or without an argument #8

Open
wimstefan opened this issue Jun 27, 2013 · 12 comments

Comments

@wimstefan
Copy link

:autocmd VimEnter
--- Auto-Commands ---
VIM_PLUGIN_MANAGER VimEnter
* call vam#SourceMissingPlugins()
NERDTreeHijackNetrw VimEnter
* silent! autocmd! FileExplorer
call nerdtree#checkForBrowse(expand(""))
PluginEasyTags VimEnter
* call xolox#easytags#register(1)
Vimpanel VimEnter
* silent! autocmd! FileExplorer
fugitive VimEnter
* if expand('')==''|call fugitive#detect(getcwd())|endif
SmartusLine VimEnter
* call SmartusLineWin('Enter')
Press ENTER or type command to continue

@wimstefan
Copy link
Author

Is it a solution to make that autocommand configurable?

@mhinz
Copy link

mhinz commented Jun 27, 2013

To clarify it a bit: both plugins (NERDTree and vimpanel) seem to do the same on VimEnter. But when doing vim <directory> he wants NERDTree to be opened instead of vimpanel.

Is there something you can do to make that configurable?

@mihaifm
Copy link
Owner

mihaifm commented Jun 27, 2013

hi
that's strange...
Do you get any additional errors, or is it just this behaviour?
In my config it's opening NERDTree. Vimpanel shouldn't do anything when you start vim with a directory argument....unless perhaps you have it setup in your .vimrc to load when vim starts.

@wimstefan
Copy link
Author

No I don't get any errors ... I was just wondering about this behaviour since I didn't expect it.
Could it be caused by the way vim-addon-manager is loading the scripts at start?

@MarcWeber
Copy link

@wimstefan: VAM is complex, you can configure it in many ways. Eg you can force loading plugin files "earlier" then after .vimrc has been processed. How to find out whether its a VAM bug:

  1. Create a simple .vimrc, only loading that one plugin by VAM. Problem still exists?
  2. load plugin without vam (eg by copying to .vim or by set rtp+=~/.vim/vim-addons/the-plugin)
    Problem gone? Its a VAM bug. File a bug report at vim-addon-manager then.

VAM does some magic (such as emitting VimEnter if you load plugins after Vim has started up).
If its causing trouble we have to drop that feature or make it optional and offload this problem to plugin authors.
I know that The_NERD_Tree is using such. I don't know about vimpanel

@mihaifm
Copy link
Owner

mihaifm commented Jun 27, 2013

@wimstefan it would help if you linked to your .vimrc

@wimstefan
Copy link
Author

@wimstefan
Copy link
Author

OK guys ... I ran through the procedure as suggested by MarcWeber above and the result is that the problem persists even when VAM is not used at all (running vim with this vimrc -> https://gist.github.com/wimstefan/bc45f5e6dc80a06d0bf9) ...
If doing so I still don't get a Fileexplorer and just see a buffer called "vimpanel-".

":autocmd VimEnter" shows this:
--- Auto-Commands ---
Vimpanel VimEnter
* silent! autocmd! FileExplorer

@mihaifm
Copy link
Owner

mihaifm commented Jun 27, 2013

that's good to know....it means that vimpanel is capturing that event (here), instead of NERDTree. Still not replicating on my sytem, but I'll try it with your config, perhaps check it on Linux as well.

@mihaifm
Copy link
Owner

mihaifm commented Jun 27, 2013

i've put in a fix, can you try it out?

@wimstefan
Copy link
Author

Thanks for trying to fix it!
I updated to the latest version but still no fileexplorer :-/

Invoking vim with "vim /.vim/bundle/Vimpanel" shows a message "/.vim/bundle/Vimpanel is a directory" and that's it.

":autocmd VimEnter" still gives the same as in the very first report ...

@wimstefan
Copy link
Author

Here is the output of "vim --version" -> https://gist.github.com/anonymous/5881042
I notice the "-browse" flag but I have to admit I'm not sure what it means ...

@mihaifm mihaifm reopened this Jun 28, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants