comparison runtime/doc/channel.txt @ 18831:6848b809a26e

Runtime file updates. Commit: https://github.com/vim/vim/commit/664f3cf3f21d3699bfd179c318ef5c869c085648 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Dec 7 16:03:51 2019 +0100 Runtime file updates.
author Bram Moolenaar <Bram@vim.org>
date Sat, 07 Dec 2019 16:15:05 +0100
parents 8ac85adee561
children af69c9335223
comparison
equal deleted inserted replaced
18830:a5749be04ad3 18831:6848b809a26e
1 *channel.txt* For Vim version 8.1. Last change: 2019 Sep 11 1 *channel.txt* For Vim version 8.1. Last change: 2019 Dec 07
2 2
3 3
4 VIM REFERENCE MANUAL by Bram Moolenaar 4 VIM REFERENCE MANUAL by Bram Moolenaar
5 5
6 6
221 difference between MS-Windows and Unix: On Unix when the port doesn't exist 221 difference between MS-Windows and Unix: On Unix when the port doesn't exist
222 ch_open() fails quickly. On MS-Windows "waittime" applies. 222 ch_open() fails quickly. On MS-Windows "waittime" applies.
223 *E898* *E901* *E902* 223 *E898* *E901* *E902*
224 224
225 If there is an error reading or writing a channel it will be closed. 225 If there is an error reading or writing a channel it will be closed.
226 *E630* *E631* 226 *E630* *E631*
227 227
228 ============================================================================== 228 ==============================================================================
229 4. Using a JSON or JS channel *channel-use* 229 4. Using a JSON or JS channel *channel-use*
230 230
231 If mode is JSON then a message can be sent synchronously like this: > 231 If mode is JSON then a message can be sent synchronously like this: >
750 let job = job_start(command, {"out_cb": "MyHandler", 750 let job = job_start(command, {"out_cb": "MyHandler",
751 \ "err_cb": "ErrHandler"}) 751 \ "err_cb": "ErrHandler"})
752 752
753 If you want to handle both stderr and stdout with one handler use the 753 If you want to handle both stderr and stdout with one handler use the
754 "callback" option: > 754 "callback" option: >
755 let job = job_start(command, {"callback": "MyHandler"}) 755 let job = job_start(command, {"callback": "MyHandler"})
756 756
757 Depending on the system, starting a job can put Vim in the background, the 757 Depending on the system, starting a job can put Vim in the background, the
758 started job gets the focus. To avoid that, use the `foreground()` function. 758 started job gets the focus. To avoid that, use the `foreground()` function.
759 This might not always work when called early, put in the callback handler or 759 This might not always work when called early, put in the callback handler or
760 use a timer to call it after the job has started. 760 use a timer to call it after the job has started.