forked from aniani/vim
Update runtime files.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
*channel.txt* For Vim version 7.4. Last change: 2016 Jan 31
|
||||
*channel.txt* For Vim version 7.4. Last change: 2016 Feb 04
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -11,7 +11,7 @@ DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT
|
||||
Vim uses channels to communicate with other processes.
|
||||
A channel uses a socket. *socket-interface*
|
||||
|
||||
Vim current supports up to 10 simultanious channels.
|
||||
Vim current supports up to 10 simultaneous channels.
|
||||
The Netbeans interface also uses a channel. |netbeans|
|
||||
|
||||
1. Demo |channel-demo|
|
||||
@@ -32,13 +32,13 @@ $VIMRUNTIME/tools/demoserver.py
|
||||
Run it in one terminal. We will call this T1.
|
||||
|
||||
Run Vim in another terminal. Connect to the demo server with: >
|
||||
let handle = connect('localhost:8765', 'json')
|
||||
let handle = ch_open('localhost:8765', 'json')
|
||||
|
||||
In T1 you should see:
|
||||
=== socket opened === ~
|
||||
|
||||
You can now send a message to the server: >
|
||||
echo sendexpr(handle, 'hello!')
|
||||
echo ch_sendexpr(handle, 'hello!')
|
||||
|
||||
The message is received in T1 and a response is sent back to Vim.
|
||||
You can see the raw messages in T1. What Vim sends is:
|
||||
@@ -57,19 +57,19 @@ To handle asynchronous communication a callback needs to be used: >
|
||||
func MyHandler(handle, msg)
|
||||
echo "from the handler: " . a:msg
|
||||
endfunc
|
||||
call sendexpr(handle, 'hello!', "MyHandler")
|
||||
call ch_sendexpr(handle, 'hello!', "MyHandler")
|
||||
|
||||
Instead of giving a callback with every send call, it can also be specified
|
||||
when opening the channel: >
|
||||
call disconnect(handle)
|
||||
let handle = connect('localhost:8765', 'json', "MyHandler")
|
||||
call sendexpr(handle, 'hello!', 0)
|
||||
call ch_close(handle)
|
||||
let handle = ch_open('localhost:8765', 'json', "MyHandler")
|
||||
call ch_sendexpr(handle, 'hello!', 0)
|
||||
|
||||
==============================================================================
|
||||
2. Opening a channel *channel-open*
|
||||
|
||||
To open a channel:
|
||||
let handle = connect({address}, {mode}, {callback})
|
||||
To open a channel: >
|
||||
let handle = ch_open({address}, {mode}, {callback})
|
||||
|
||||
{address} has the form "hostname:port". E.g., "localhost:8765".
|
||||
|
||||
@@ -84,7 +84,7 @@ message. Example: >
|
||||
func Handle(handle, msg)
|
||||
echo 'Received: ' . a:msg
|
||||
endfunc
|
||||
let handle = connect("localhost:8765", 'json', "Handle")
|
||||
let handle = ch_open("localhost:8765", 'json', "Handle")
|
||||
|
||||
When {mode} is "json" the "msg" argument is the body of the received message,
|
||||
converted to Vim types.
|
||||
@@ -94,11 +94,11 @@ When {mode} is "json" the {callback} is optional. When omitted it is only
|
||||
possible to receive a message after sending one.
|
||||
|
||||
The handler can be added or changed later: >
|
||||
call sethandler(handle, {callback})
|
||||
call ch_setcallback(handle, {callback})
|
||||
When {callback} is empty (zero or an empty string) the handler is removed.
|
||||
|
||||
Once done with the channel, disconnect it like this: >
|
||||
call disconnect(handle)
|
||||
call ch_close(handle)
|
||||
|
||||
Currently up to 10 channels can be in use at the same time. *E897*
|
||||
|
||||
@@ -112,15 +112,15 @@ If there is an error reading or writing a channel it will be closed.
|
||||
3. Using a JSON channel *channel-use*
|
||||
|
||||
If {mode} is "json" then a message can be sent synchronously like this: >
|
||||
let response = sendexpr(handle, {expr})
|
||||
let response = ch_sendexpr(handle, {expr})
|
||||
This awaits a response from the other side.
|
||||
|
||||
To send a message, without handling a response: >
|
||||
call sendexpr(handle, {expr}, 0)
|
||||
call ch_sendexpr(handle, {expr}, 0)
|
||||
|
||||
To send a message and letting the response handled by a specific function,
|
||||
asynchronously: >
|
||||
call sendexpr(handle, {expr}, {callback})
|
||||
call ch_sendexpr(handle, {expr}, {callback})
|
||||
|
||||
The {expr} is converted to JSON and wrapped in an array. An example of the
|
||||
message that the receiver will get when {expr} is the string "hello":
|
||||
@@ -148,7 +148,7 @@ 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 disconnect() the string "DETACH" is sent, if still possible.
|
||||
On read error or ch_close() the string "DETACH" is sent, if still possible.
|
||||
The channel will then be inactive.
|
||||
|
||||
==============================================================================
|
||||
@@ -200,7 +200,7 @@ You can also use "call |feedkeys()|" to insert any key sequence.
|
||||
|
||||
Command "normal" ~
|
||||
|
||||
The "normal" command is executed like with |:normal!|, commands are not
|
||||
The "normal" command is executed like with ":normal!", commands are not
|
||||
mapped. Example to open the folds under the cursor:
|
||||
["normal" "zO"]
|
||||
|
||||
@@ -230,19 +230,19 @@ Example:
|
||||
5. Using a raw channel *channel-raw*
|
||||
|
||||
If {mode} is "raw" then a message can be send like this: >
|
||||
let response = sendraw(handle, {string})
|
||||
let response = ch_sendraw(handle, {string})
|
||||
The {string} is sent as-is. The response will be what can be read from the
|
||||
channel right away. Since Vim doesn't know how to recognize the end of the
|
||||
message you need to take care of it yourself.
|
||||
|
||||
To send a message, without expecting a response: >
|
||||
call sendraw(handle, {string}, 0)
|
||||
call ch_sendraw(handle, {string}, 0)
|
||||
The process can send back a response, the channel handler will be called with
|
||||
it.
|
||||
|
||||
To send a message and letting the response handled by a specific function,
|
||||
asynchronously: >
|
||||
call sendraw(handle, {string}, {callback})
|
||||
call ch_sendraw(handle, {string}, {callback})
|
||||
|
||||
This {string} can also be JSON, use |jsonencode()| to create it and
|
||||
|jsondecode()| to handle a received JSON message.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*eval.txt* For Vim version 7.4. Last change: 2016 Feb 02
|
||||
*eval.txt* For Vim version 7.4. Last change: 2016 Feb 04
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -2684,7 +2684,7 @@ ch_open({address}, {mode} [, {callback}]) *ch_open()*
|
||||
{callback} is a function that handles received messages on the
|
||||
channel. See |channel-callback|.
|
||||
|
||||
ch_sendexpr({handle}, {expr} [, {callback}]) ch_*sendexpr()*
|
||||
ch_sendexpr({handle}, {expr} [, {callback}]) *ch_sendexpr()*
|
||||
Send {expr} over JSON channel {handle}. See |channel-use|.
|
||||
|
||||
When {callback} is given returns immediately. Without
|
||||
|
||||
@@ -5156,6 +5156,10 @@ catch-text eval.txt /*catch-text*
|
||||
cc change.txt /*cc*
|
||||
ceil() eval.txt /*ceil()*
|
||||
ch.vim syntax.txt /*ch.vim*
|
||||
ch_close() eval.txt /*ch_close()*
|
||||
ch_open() eval.txt /*ch_open()*
|
||||
ch_sendexpr() eval.txt /*ch_sendexpr()*
|
||||
ch_sendraw() eval.txt /*ch_sendraw()*
|
||||
change-list-jumps motion.txt /*change-list-jumps*
|
||||
change-name tips.txt /*change-name*
|
||||
change-tabs change.txt /*change-tabs*
|
||||
@@ -5321,7 +5325,6 @@ complex-repeat repeat.txt /*complex-repeat*
|
||||
compress pi_gzip.txt /*compress*
|
||||
conceal syntax.txt /*conceal*
|
||||
confirm() eval.txt /*confirm()*
|
||||
connect() eval.txt /*connect()*
|
||||
connection-refused message.txt /*connection-refused*
|
||||
console-menus gui.txt /*console-menus*
|
||||
control intro.txt /*control*
|
||||
@@ -7917,8 +7920,6 @@ sed.vim syntax.txt /*sed.vim*
|
||||
self eval.txt /*self*
|
||||
send-money sponsor.txt /*send-money*
|
||||
send-to-menu gui_w32.txt /*send-to-menu*
|
||||
sendexpr() eval.txt /*sendexpr()*
|
||||
sendraw() eval.txt /*sendraw()*
|
||||
sendto gui_w32.txt /*sendto*
|
||||
sentence motion.txt /*sentence*
|
||||
server-functions usr_41.txt /*server-functions*
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*todo.txt* For Vim version 7.4. Last change: 2016 Feb 01
|
||||
*todo.txt* For Vim version 7.4. Last change: 2016 Feb 04
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -81,19 +81,36 @@ Regexp problems:
|
||||
Patch by Christian, 2016 Jan 29.
|
||||
|
||||
+channel:
|
||||
- implement wait for receiving end of Json.
|
||||
- implement only reading up to end of Json.
|
||||
- use a timeout for connect()
|
||||
Patch from Yasuhiro Matsumoto, Feb 2
|
||||
Change connect() second argument to a dict with items:
|
||||
mode
|
||||
timeout
|
||||
callback
|
||||
- When receiving malformed json starting with a quote it doesn't get
|
||||
discarded.
|
||||
- add ch_setcallback()
|
||||
- add ch_settimeout()
|
||||
- cleanup on exit? in mch_getout() and getout().
|
||||
- Add more contents to channel.txt
|
||||
- implement debug log
|
||||
- implement job control
|
||||
- implement job control:
|
||||
let job = job_start('command', {options})
|
||||
call job_stop(job)
|
||||
let job = job_maystart('command', {address}, {options})
|
||||
options:
|
||||
- keep running when Vim exits
|
||||
- add remark undo sync, is there a way to force it?
|
||||
- Add a test with a server that can send canned responses.
|
||||
- Add more testing in json_test.c
|
||||
- make sure errors lead to a useful error msg. ["ex","foobar"]
|
||||
- use a timeout for connect() Patch from Yasuhiro Matsumoto, Feb 1
|
||||
- set timeout for channel.
|
||||
- implement check for ID in response.
|
||||
- json: implement UTF-16 surrogate pair.
|
||||
|
||||
Patch on #608: (Ken Takata)
|
||||
https://bitbucket.org/k_takata/vim-ktakata-mq/src/479934b94fd56b064c9e4bd8737585c5df69d56a/fix-gvimext-loadlibrary.patch?fileviewer=file-view-default
|
||||
|
||||
This difference is unexpected:
|
||||
echo v:true == 1
|
||||
1
|
||||
@@ -109,6 +126,14 @@ Patch to put undo options together in undo window.
|
||||
Patch for clearing history. (Yegappan Lakshmanan, 2016 Jan 31, second message
|
||||
has tests)
|
||||
|
||||
Patch to update the GTK icon cache when installing. (Kazunobu Kuriyama, 2016
|
||||
Feb 3)
|
||||
|
||||
Patch for test86 and test87. (Roland Puntaier, #622)
|
||||
|
||||
Patch for Python: #622. (Roland Puntaier, 2016 Feb 2)
|
||||
What does it change?
|
||||
|
||||
Need to try out instructions in INSSTALLpc.txt about how to install all
|
||||
interfaces and how to build Vim with them.
|
||||
Appveyor build with self-installing executable, includes getting most
|
||||
@@ -132,6 +157,8 @@ What if there is an invalid character?
|
||||
Should jsonencode()/jsondecode() restrict recursiveness?
|
||||
Or avoid recursiveness.
|
||||
|
||||
Patch to fix bug in statusline highlighting. (Christian Brabandt, 2016 Feb 2)
|
||||
|
||||
Use vim.vim syntax highlighting for help file examples, but without ":" in
|
||||
'iskeyword' for syntax.
|
||||
|
||||
@@ -161,15 +188,16 @@ Patch to avoid redrawing tabline when the popup menu is visible.
|
||||
|
||||
Win32: patch to use 64 bit stat() if possible. (Ken Takata, 2014 May 12)
|
||||
More tests May 14. Update May 29. Update Aug 10.
|
||||
Now part of large file patches. (Ken Takata, 2016 Jan 19, second one)
|
||||
Updated patches with ordering: Jan 20.
|
||||
And another update: Jan 24, then Jan 29, 30, Feb 1.
|
||||
Now part of large file patches. (Ken Takata, 2016 Feb 1)
|
||||
Two patches now?
|
||||
|
||||
Patch to support 64 bit ints for Number. (Ken Takata, 2016 Jan 21)
|
||||
|
||||
7 Add a watchpoint in the debug mode: An expression that breaks execution
|
||||
when evaluating to non-zero. Add the "watchadd expr" command, stop when
|
||||
the value of the expression changes. ":watchdel" deletes an item,
|
||||
":watchlist" lists the items. (Charles Campbell)
|
||||
Patch by Christian Brabandt, 2016 Jan 27.
|
||||
Patch by Christian Brabandt, 2016 Feb 1.
|
||||
|
||||
Patch to be able to use hex numbers with :digraph. (Lcd, 2015 Sep 6)
|
||||
Update Sep 7. Update by Christian Brabandt, 2015 Sep 8, 2016 Feb 1.
|
||||
@@ -182,6 +210,9 @@ Patch to add <restore> to :windo, :bufdo, etc. (Christian Brabandt, 2015 Jan
|
||||
6, 2nd message)
|
||||
Alternative: ":keeppos" command modifier: ":keeppos windo {cmd}".
|
||||
|
||||
Patch to fix that executable() may fail on very long filename in MS-Windows.
|
||||
(Ken Takata, 2016 Feb 1)
|
||||
|
||||
Patch to fix display of listchars on the cursorline. (Nayuri Aohime, 2013)
|
||||
Update suggested by Yasuhiro Matsumoto, 2014 Nov 25:
|
||||
https://gist.github.com/presuku/d3d6b230b9b6dcfc0477
|
||||
@@ -193,8 +224,6 @@ Gvim: when both Tab and CTRL-I are mapped, use CTRL-I not for Tab.
|
||||
Unexpected delay when using CTRL-O u. It's not timeoutlen.
|
||||
(Gary Johnson, 2015 Aug 28)
|
||||
|
||||
Patch to support 64 bit ints for Number. (Ken Takata, 2016 Jan 21)
|
||||
|
||||
Instead of separately uploading patches to the ftp site, we can get them from
|
||||
github with a URL like this:
|
||||
https://github.com/vim/vim/compare/v7.4.920%5E...v7.4.920.diff
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*usr_41.txt* For Vim version 7.4. Last change: 2016 Jan 28
|
||||
*usr_41.txt* For Vim version 7.4. Last change: 2016 Feb 02
|
||||
|
||||
VIM USER MANUAL - by Bram Moolenaar
|
||||
|
||||
@@ -894,10 +894,10 @@ Testing: *test-functions*
|
||||
assert_true() assert that an expression is true
|
||||
|
||||
Inter-process communication:
|
||||
connect() open a channel
|
||||
disconnect() close a channel
|
||||
sendexpr() send a JSON message over a channel
|
||||
sendraw() send a raw message over a channel
|
||||
ch_open() open a channel
|
||||
ch_close() close a channel
|
||||
ch_sendexpr() send a JSON message over a channel
|
||||
ch_sendraw() send a raw message over a channel
|
||||
jsonencode() encode an expression to a JSON string
|
||||
jsondecode() decode a JSON string to Vim types
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*windows.txt* For Vim version 7.4. Last change: 2015 Nov 14
|
||||
*windows.txt* For Vim version 7.4. Last change: 2016 Feb 01
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -721,7 +721,7 @@ can also get to them with the buffer list commands, like ":bnext".
|
||||
*:bufdo*
|
||||
:[range]bufdo[!] {cmd} Execute {cmd} in each buffer in the buffer list or if
|
||||
[range] is given only for buffers for which their
|
||||
buffer numer is in the [range]. It works like doing
|
||||
buffer number is in the [range]. It works like doing
|
||||
this: >
|
||||
:bfirst
|
||||
:{cmd}
|
||||
|
||||
Reference in New Issue
Block a user