Mercurial > vim
diff runtime/doc/channel.txt @ 8148:f5da459c5698
commit https://github.com/vim/vim/commit/e0fa3742ead676a3074a10edadbc955e1a89153d
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Feb 20 15:47:01 2016 +0100
Updated runtime files.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 20 Feb 2016 16:00:06 +0100 |
parents | 18a3f0f05244 |
children | 9ca3885edfed |
line wrap: on
line diff
--- a/runtime/doc/channel.txt +++ b/runtime/doc/channel.txt @@ -1,4 +1,4 @@ -*channel.txt* For Vim version 7.4. Last change: 2016 Feb 16 +*channel.txt* For Vim version 7.4. Last change: 2016 Feb 20 VIM REFERENCE MANUAL by Bram Moolenaar @@ -155,7 +155,6 @@ When "mode" is "raw" the "msg" argument When "mode" is "json" or "js" the "callback" is optional. When omitted it is only possible to receive a message after sending one. -TODO: To change the channel options after opening it use ch_setoptions(). The arguments are similar to what is passed to ch_open(), but "waittime" cannot be given, since that only applies to opening the channel. @@ -233,8 +232,8 @@ message, it must use the number zero: Then channel handler will then get {response} converted to Vim types. If the channel does not have a handler the message is dropped. -On read error or ch_close() the string "DETACH" is sent, if still possible. -The channel will then be inactive. +On read error or ch_close(), when using a socket, the string "DETACH" is sent, +if still possible. The channel will then be inactive. It is also possible to use ch_sendraw() on a JSON or JS channel. The caller is then completely responsible for correct encoding and decoding. @@ -295,9 +294,11 @@ Command "eval" ~ The "eval" command an be used to get the result of an expression. For example, to get the number of lines in the current buffer: - ["eval","line('$')"] ~ + ["eval","line('$')", -2] ~ it will send back the result of the expression: + [-2, "last line"] ~ +The format is: [{number}, {result}] Here {number} is the same as what was in the request. Use a negative number to avoid confusion with message that Vim sends.