-
-
Notifications
You must be signed in to change notification settings - Fork 197
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
Do not source when the plugin has been sourced #35
Conversation
's:source_plugin' possibly called twice or more when the plugin is depended from several plugins. This commit simply skip if the plugin is already sourced, to prevent unnecessary function call and &runtimepath duplication.
@@ -167,6 +167,9 @@ function! dein#autoload#_dummy_complete(arglead, cmdline, cursorpos) abort "{{{ | |||
endfunction"}}} | |||
|
|||
function! s:source_plugin(rtps, index, plugin) abort "{{{ | |||
if a:plugin.sourced |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was not really sure that I should use get(a:plugin, 'sourced')
or not.
While dein.vim care about the startup speed, I just use a:plugin.source
but if a:plugin
could be an empty dictionary, it should be get(a:plugin, 'sourced')
and I'll fix it then ;-)
Before this patch
After this patch
|
It seems this change cause the following exception on startup. I'll fix and re-PR
|
No. It seems that exception is not because of this PR (the exception could be shown even in 64397f6). It because of the following line in my [[plugins]]
repo = 'Shougo/dein.vim'
rtp = '' This is completely different issue so I re-PR. |
@lambdalisue Hi, is this |
dein.vim can parse the TOML config. |
Do not source when the plugin has been sourced
Thanks ;-) |
OK, thanks. |
Is |
@lambdalisue It seems Vim's bug. |
Ok. I'll do |
Ok. I couldn't reproduce that anymore. Maybe my configuration was wrong during development. I'm sorry for bothering you. |
Oh, ... Hm |
@lambdalisue @Shougo Yeah, I know the TOML parser is implemented both in neobundle and dein. However, could you please point me to an example TOML plugin config file and possibly a simple |
This is my TOML config. https://github.com/Shougo/shougo-s-github/blob/master/vim/rc/dein.toml |
Amazing! Thank you very much! |
's:source_plugin' possibly called twice or more when the plugin is depended from several plugins.
This commit simply skip if the plugin is already sourced, to prevent unnecessary function call and
&runtimepath duplication.