asynctasks.vim icon indicating copy to clipboard operation
asynctasks.vim copied to clipboard

Support for callbacks after a task is complete?

Open kvalv opened this issue 4 years ago • 1 comments

Hey,

This is a really neat plugin, and I already have defined a bunch of tasks. One feature I haven't found yet and that I miss is the ability to have a (vimscript) callback on exit. In particular, I want to update my statusline (e.g. have a red square) if the exit code is >= 1 , green square if the exit code is 0 and a yellow square if the task is still running.

  1. Is it possible to do something like that already?
  2. If not, would you consider adding a callback feature that would enable me to do this?

Edit: Looks like the notify example is a nice starting point if I just want the message to be echoed on the statusline. In that case, I'll add notify=echo to the task. It would be nice to also have notify=callback:my_vimscript_function that I could call.

kvalv avatar Jul 14 '21 17:07 kvalv

https://github.com/skywind3000/asynctasks.vim/wiki/Task-Examples#silence-and-notify

please update to the latest version, notify no accept vimscript starting with a :

notify=:call MyTaskFinished()

skywind3000 avatar Nov 30 '21 05:11 skywind3000