Nicolas
Le dimanche 10 décembre 2023 à 20:55:57 UTC+1, Lifepillar a écrit :
On 2023-12-09, Nicolas <niva...@gmail.com> wrote:
> Hi all,
>
> According to Bram example in the job's help now,
> Is it possible to pass additional parameters to job's handlers callback in
> vim9script ?
Yes. See, for instance, $VIMRUNTIME/autoload/typeset.vim, in particular
the Callbacks section and the Typeset() function.
> This minimal example with additional params:
> def Compress_OnExit(job_id: job, exit_status: number, foo: string): void
> echom 'Job OnExit ' .. job_id->string() .. ' exited with status ' ..
> exit_status
> # Compress_CopyToDrive('PATRIOT')
> enddef
> var job = job_start(cmd, { 'exit_cb': function('Compress_OnExit',
> ['foo']) } )
That should be:
var job = job_start(['ls'], {
exit_cb: (j, e) => Compress_OnExit(j, e, 'foo')
})
Hope this helps,
Life.
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/4cf67b5b-f6d8-4d85-8d59-84f67168a9b4n%40googlegroups.com.
No comments:
Post a Comment