Open ilAYAli opened 7 years ago
Just like most IDE, asyncrun can support only one background job at the sametime. but different window has its own location list. that means when you are running 'AsyncRun' in different window, you will get a different result.
Supporting multi-job is a bit complex, for example, :AsyncStop
must have a new parameter to indicate which job you want to stop, and :AsyncRun
will returns current job id , and there must be a new :AsyncList
to show currently running jobs.
There an both hard to implement and hard to use.
So, asyncrun is designed to run only one background job at the sametime, which will make my workflow much easier.
Agreed, but as a start, just allow a single invocation.
Optionally make a subsequent job invocation, cancel the first.
The latter is also preferable if you e.g AsyncRun
make
, and see that you have made a typo, so you want to fix the typo, and immediately restart the job.
Just like most IDE, asyncrun can support only one background job at the sametime. but different window has its own location list. that means when you are running 'AsyncRun' in different window, you will get a different result.
Supporting multi-job is a bit complex, for example,
:AsyncStop
must have a new parameter to indicate which job you want to stop, and:AsyncRun
will returns current job id , and there must be a new:AsyncList
to show currently running jobs.There an both hard to implement and hard to use.
So, asyncrun is designed to run only one background job at the sametime, which will make my workflow much easier.
Maybe user don't need to give a jobid paramter when calling:AsyncStop
. If
:AsyncStop
while previously focused on a location list window, asyncrun might be able to tell which job is running in the location list window, and can stop that job. Though, for safty concerns, asyncrun might need to popup a confirm message to let user know which job he/she is stopping.I just installed asyncrun, and the first thing come up to me is: This is so coooool, and if it just can support multiple jobs, that will be much cooler!!
Try -mode=term
:
:AsyncRun -mode=term -pos=term echo 1234 && sleep 3 && echo 56789
This command supports multiple tasks running at the same time.
@skywind3000
Unfortunately, seems like running -mode=term doesn't trigger AsyncRunStop.
The main problem with using quickfix is that, there's just one quickfix window. And many other plugins populate quickfix list as well, which messes up the output.
To give you an example, let's say I am running a build, in the meantime I am using vim-lsp to jump to the usage of a function, that also populates quickfix list, so the output is messed up.
So it'll be great to have location list support.
I think it'll be even better if this plugin creates a buffer of its own. That way it can keep that singleton (i.e. no more than one runs), also it won't conflict with other plugins.
I think it's not ideal to use quickfix, as there's only one of it, and many plugins throw their result onto it, which messes it up.
Agreed, but as a start, just allow a single invocation. Optionally make a subsequent job invocation, cancel the first. The latter is also preferable if you e.g AsyncRun make, and see that you have made a typo, so you want to fix the typo, and immediately restart the job.
I agree with this. Multiple jobs is nice, but it's not a pre-requisite to location list support. You could still serialize jobs even with location list, and just don't allow further AsyncRun calls while a job is running. The benefit to location list is just to have multiple quickfix lists to choose from (e.g. on one window you did a grep, and on the other window you invoked make
to compile). They don't have to all run at the same time.
It would be very nice with location list support, as I much prefer that to quickfix.