Rip-Rip/clang_complete — pull request #183 by oblitum (2012-08-12 04:06:47+00:00)
Title: Correct delay-loading of g:clang_user_options after VIM's initialization

I use the [vimprj](http://www.vim.org/scripts/script.php?script_id=3872) plugin for generic cascade configuration loading for VIM. I realized it was not working with clang, because I was using `g:clang_user_options` to configure additional include directories for completion, but it wasn't working.

I figured out clang was parsing `g:clang_user_options` to early, before the `time.sleep(0.1)` for proper VIM initialization in the `CompleteThread `.

The clang arguments are being passed around as a parameter between several functions, but these clang arguments only have usage at the first `index.parse`, the following `reparse`'s will not benefit from new or changed parameters because `reparse` does not accept new ones, it runs based on the first `index.parse` configuration.

So, beyond this quick fix, I think some refactoring on args usage would be good. They get initialized once, as a _setting_, so I'm doubting whether it needs to be passed around in function arguments for no use.

I don't like to much configuration files, so I don't use `.clang_complete`'s since I thought vimprj could do that job very well already. It's built just for this functionality of cascade configuration loading and one configuration file for that I think is enough.

This fix makes clang_complete compatible with vimprj and other plugins for that kind of functionality. I'm just setting `g:clang_user_options` in its configuration files in the directory tree.