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

Fix 'Key not present in Dictionary: hook_source' issue #44

Closed
wants to merge 1 commit into from
Closed

Fix 'Key not present in Dictionary: hook_source' issue #44

wants to merge 1 commit into from

Conversation

lambdalisue
Copy link
Contributor

A commit 50b6e38 introduced a bug shown below. That happen every time when I tried to source lazy plugins.
This commit fix that issue.

selection_013

@@ -358,14 +358,14 @@ function! dein#util#_call_hook(hook_name, ...) abort "{{{
let hook = 'hook_' . a:hook_name
let plugins = filter(dein#util#_get_plugins((a:0 ? a:1 : [])),
\ "v:val.sourced && (exists(prefix . v:val.name)
\ || !empty(v:val[hook]))")
\ || !empty(get(v:val, hook)))")

for plugin in dein#util#_tsort(plugins)
let autocmd = 'dein#' . a:hook_name . '#' . plugin.name
if exists('#User#'.autocmd)
execute 'doautocmd User' autocmd
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additionally, I suggest to add <nomodeline> while dein.vim only support Vim 7.4 or later.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this is needed?
Please explain it.
I have not ESP skils.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this is needed?
Please explain it.

I think you got already but in case, the reason is written in doautocmd section in Vim's help.

@Shougo
Copy link
Owner

Shougo commented Mar 19, 2016

I cannot reproduce the problem.
Why this check is needed?
Please upload the minimal .vimrc to reproduce it.

@lambdalisue
Copy link
Contributor Author

Please upload the minimal .vimrc to reproduce it.

Ok.

@lambdalisue
Copy link
Contributor Author

I got it. It is a problem of ~/.vim/bundle/cache_vim and #45

This is my guess but dein#update() remove cache like ~/.vim/bundle/cache_vim right?

As I said, my dein.vim was in ~/.vim/bundle/repos/dein.vim so I update it manually.
plugin instance in previous cache_vim does not have hook_source attributes so the error has shown I guess.

Now I remove cache and tried from the beginning. Everything works correctly.

Sorry for take your time.

@lambdalisue lambdalisue deleted the hotfix/call_hook branch March 19, 2016 09:37
@Shougo
Copy link
Owner

Shougo commented Mar 19, 2016

OK.

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

Successfully merging this pull request may close these issues.

2 participants