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

"post-install-hook" doesn't run on activate #141

Closed
dbarnett opened this issue Jan 18, 2014 · 3 comments
Closed

"post-install-hook" doesn't run on activate #141

dbarnett opened this issue Jan 18, 2014 · 3 comments

Comments

@dbarnett
Copy link

The help says

Hook              Case ~
post-install      After successfully installing a plugin using 
                  |:ActivateAddons| or running |:RunInstallHooks|.

but post-install-hook commands seem to only be run after :InstallAddons, and only if the addon wasn't already installed.

Is this a bug in the code or documentation?

@dbarnett
Copy link
Author

If "post-install-hook" really is only intended to run after successful plugin installation, it would be extremely handy to add a "post-activate-hook" that runs on activate.

I'm from the google/maktaba team and I discovered that VAM and the addon-info.json spec would be brilliant for managing plugins built on maktaba. maktaba does some initialization of its own for newly-activated plugins, and a "post-activate-hook" would allow us to kick off that initialization.

@ZyX-I
Copy link
Collaborator

ZyX-I commented Jan 18, 2014

This hook must not run on :InstallAddons. It should be run on :ActivateAddons if and only if plugin is going to be installed as stated in documentation.

Post activate hook will not be added. :ActivateAddons does little more then modifying runtimepath setting if vim has not already fully started and sources plugin files if vim has already started (see :h startup, search for has("vim_starting")). Thus most likely hook will be run in wrong time. We can add a hook that will run either on VimEnter event or after plugin files were sourced (if they are sourced by VAM), but we cannot add a hook that is run just after plugin files were sourced.

Wondering what initialization do you need that has to be run on each plugin activation.


If you want to say that after calling vam#ActivateAddons or :ActivateAddons hook does not run then please provide an example (i.e. a plugin which has hook definition, but this hook is not run; and exactly how did you install and activate it). If you want to add a new hook you should open a separate issue.

@dbarnett
Copy link
Author

I guess I misspoke when I mentioned :InstallAddons. I wasn't able to trigger it on a plugin I was working on locally since it was on my filesystem and always considered already "installed". I was trying to figure out how it worked reading the code.

Filed a separate feature request for "post-activate-hook" at #142.

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

2 participants