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

Request: Custom callback function #40

Closed
svermeulen opened this issue Jun 23, 2013 · 7 comments
Closed

Request: Custom callback function #40

svermeulen opened this issue Jun 23, 2013 · 7 comments

Comments

@svermeulen
Copy link

In some cases it would be useful to be able to notify other plugins when the build is finished. It would be great if you could set a custom callback function along with the arguments passed to start()

@tpope
Copy link
Owner

tpope commented Jun 23, 2013

Dispatch fires a QuickFixCmdPost cgetfile event each time a build finishes, with 'makeprg' and 'errorformat' set appropriately. Need anything else?

@svermeulen
Copy link
Author

I didn't consider that. That still doesn't quite work though because that autocommand doesn't appear to be run when the 'background' parameter is set to 1 (and this is the common scenario in my case).

@tpope
Copy link
Owner

tpope commented Jun 23, 2013

There is no background event, as it's impossible to reliably produce one.

@svermeulen
Copy link
Author

Right now I just have some calls added to dispatch#complete which works fine for me. At some point though I'd like to share out the code that depends on that, and in that case I'd need some other way to hook into that. So I was thinking it might be possible to have a callback function there, attached to the request object? If not I can live with that.

@svermeulen
Copy link
Author

I'd make a pull request for it if you think it might be something you'd merge?

@tpope
Copy link
Owner

tpope commented Jun 23, 2013

That doesn't fire for all background builds. Notably, it doesn't work for tmux. I don't want to expose an API that only works some of the time.

@svermeulen
Copy link
Author

Ah I see. No problem.

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