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

Wrong help for "on_source"? #32

Closed
rcmdnk opened this issue Mar 6, 2016 · 5 comments
Closed

Wrong help for "on_source"? #32

rcmdnk opened this issue Mar 6, 2016 · 5 comments
Labels

Comments

@rcmdnk
Copy link

rcmdnk commented Mar 6, 2016

Problems summary

Help for on_source seems wrong.

                                            *dein-options-on_source*
            on_source       (List) or (String)
            Load the plugin after the listed plugins are loaded.
            Note: The plugins must be lazy loaded plugins.

Expected

It should be like:

Load the plugin before the listed plugins are loaded.

before instead of after.

At settings like:

call dein#add('a.vim', {
      \ 'on_source': ['b.vim'],
      \ 'on_cmd': ['a'],
      \ 'lazy': 1})
call dein#add('b.vim', {
      \ 'on_cmd': ['b'],
      \ 'lazy':1 })

I assume "a.vim" as "the plugin" and "b.vim" as "the listed plugins",
then "a.vim" is loaded just before "b.vim" is loaded, if it is not loaded.

@wsdjeg
Copy link
Contributor

wsdjeg commented Mar 6, 2016

I think there is no error,this means a.vim is after you try to begin load b.vim.if you say a.vim is before b.vim,but what is the time ,when you start your vim ,it is also before b.vim

@Shougo
Copy link
Owner

Shougo commented Mar 6, 2016

No. It is after. Closing.
before is depends feature.

@Shougo Shougo closed this as completed Mar 6, 2016
@Shougo Shougo added the question label Mar 6, 2016
@rcmdnk
Copy link
Author

rcmdnk commented Mar 6, 2016

sorry, in example above,
"a.vim" is loaded before "b.vim", isn't it?

Actually, I could confirm it.

If "a.vim" depends on "b.vim",
then "a.vim" is loaded after b.vim, because a.vim depends on b.vim.

Maybe i just misunderstanding the sentence,
but "a.vim loaded before b.vim" is correct, right?
This is actually "on_source" function.
And this is why "b.vim" must be lazy. ("b.vim" musts not be loaded beforeaa "a.vim")

@rcmdnk
Copy link
Author

rcmdnk commented Mar 7, 2016

In the help of NeoBundle, on_source is written like:

                                            neobundle-options-on_source
            on_source       (List) or (String)
            Load the bundle when the list bundles are loaded.
            Note: If they are not autoload bundles, "on_source"
            hooks are called when VimEnter auto command.
            You can call them manually by neobundle#call_hook().
            Note: The plugins must be lazy loaded plugins.

            For example:
            if neobundle#tap('plugin-B.vim')
              call neobundle#config({
                    \  'on_source' : [ 'plugin-A.vim' ]
                    \ })
              call neobundle#untap()
            endif

            plugin-B is loaded before plugin-A is loaded.

This explains as before.
(plugin-B corresponds to a.vim and plugin-A corresponds to b.vim in above)

I could obtain same order results in both NeoBundle and dein,
so that I think dein's on_source's help should be similar to NeoBundle's one,
at least it is not after.

Shougo added a commit that referenced this issue Mar 9, 2016
@Shougo
Copy link
Owner

Shougo commented Mar 9, 2016

I get it. Fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants