Skip to content

Commit 36739b0

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents 9fab7f8 + 4b6a6dc commit 36739b0

File tree

17 files changed

+193
-79
lines changed

17 files changed

+193
-79
lines changed

runtime/doc/channel.txt

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*channel.txt* For Vim version 7.4. Last change: 2016 Jan 31
1+
*channel.txt* For Vim version 7.4. Last change: 2016 Feb 04
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -11,7 +11,7 @@ DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT
1111
Vim uses channels to communicate with other processes.
1212
A channel uses a socket. *socket-interface*
1313

14-
Vim current supports up to 10 simultanious channels.
14+
Vim current supports up to 10 simultaneous channels.
1515
The Netbeans interface also uses a channel. |netbeans|
1616

1717
1. Demo |channel-demo|
@@ -32,13 +32,13 @@ $VIMRUNTIME/tools/demoserver.py
3232
Run it in one terminal. We will call this T1.
3333

3434
Run Vim in another terminal. Connect to the demo server with: >
35-
let handle = connect('localhost:8765', 'json')
35+
let handle = ch_open('localhost:8765', 'json')
3636
3737
In T1 you should see:
3838
=== socket opened === ~
3939

4040
You can now send a message to the server: >
41-
echo sendexpr(handle, 'hello!')
41+
echo ch_sendexpr(handle, 'hello!')
4242
4343
The message is received in T1 and a response is sent back to Vim.
4444
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: >
5757
func MyHandler(handle, msg)
5858
echo "from the handler: " . a:msg
5959
endfunc
60-
call sendexpr(handle, 'hello!', "MyHandler")
60+
call ch_sendexpr(handle, 'hello!', "MyHandler")
6161
6262
Instead of giving a callback with every send call, it can also be specified
6363
when opening the channel: >
64-
call disconnect(handle)
65-
let handle = connect('localhost:8765', 'json', "MyHandler")
66-
call sendexpr(handle, 'hello!', 0)
64+
call ch_close(handle)
65+
let handle = ch_open('localhost:8765', 'json', "MyHandler")
66+
call ch_sendexpr(handle, 'hello!', 0)
6767
6868
==============================================================================
6969
2. Opening a channel *channel-open*
7070

71-
To open a channel:
72-
let handle = connect({address}, {mode}, {callback})
71+
To open a channel: >
72+
let handle = ch_open({address}, {mode}, {callback})
7373
7474
{address} has the form "hostname:port". E.g., "localhost:8765".
7575

@@ -84,7 +84,7 @@ message. Example: >
8484
func Handle(handle, msg)
8585
echo 'Received: ' . a:msg
8686
endfunc
87-
let handle = connect("localhost:8765", 'json', "Handle")
87+
let handle = ch_open("localhost:8765", 'json', "Handle")
8888
8989
When {mode} is "json" the "msg" argument is the body of the received message,
9090
converted to Vim types.
@@ -94,11 +94,11 @@ When {mode} is "json" the {callback} is optional. When omitted it is only
9494
possible to receive a message after sending one.
9595

9696
The handler can be added or changed later: >
97-
call sethandler(handle, {callback})
97+
call ch_setcallback(handle, {callback})
9898
When {callback} is empty (zero or an empty string) the handler is removed.
9999

100100
Once done with the channel, disconnect it like this: >
101-
call disconnect(handle)
101+
call ch_close(handle)
102102
103103
Currently up to 10 channels can be in use at the same time. *E897*
104104

@@ -112,15 +112,15 @@ If there is an error reading or writing a channel it will be closed.
112112
3. Using a JSON channel *channel-use*
113113

114114
If {mode} is "json" then a message can be sent synchronously like this: >
115-
let response = sendexpr(handle, {expr})
115+
let response = ch_sendexpr(handle, {expr})
116116
This awaits a response from the other side.
117117

118118
To send a message, without handling a response: >
119-
call sendexpr(handle, {expr}, 0)
119+
call ch_sendexpr(handle, {expr}, 0)
120120
121121
To send a message and letting the response handled by a specific function,
122122
asynchronously: >
123-
call sendexpr(handle, {expr}, {callback})
123+
call ch_sendexpr(handle, {expr}, {callback})
124124
125125
The {expr} is converted to JSON and wrapped in an array. An example of the
126126
message that the receiver will get when {expr} is the string "hello":
@@ -148,7 +148,7 @@ message, it must use the number zero:
148148
Then channel handler will then get {response} converted to Vim types. If the
149149
channel does not have a handler the message is dropped.
150150

151-
On read error or disconnect() the string "DETACH" is sent, if still possible.
151+
On read error or ch_close() the string "DETACH" is sent, if still possible.
152152
The channel will then be inactive.
153153

154154
==============================================================================
@@ -200,7 +200,7 @@ You can also use "call |feedkeys()|" to insert any key sequence.
200200

201201
Command "normal" ~
202202

203-
The "normal" command is executed like with |:normal!|, commands are not
203+
The "normal" command is executed like with ":normal!", commands are not
204204
mapped. Example to open the folds under the cursor:
205205
["normal" "zO"]
206206

@@ -230,19 +230,19 @@ Example:
230230
5. Using a raw channel *channel-raw*
231231

232232
If {mode} is "raw" then a message can be send like this: >
233-
let response = sendraw(handle, {string})
233+
let response = ch_sendraw(handle, {string})
234234
The {string} is sent as-is. The response will be what can be read from the
235235
channel right away. Since Vim doesn't know how to recognize the end of the
236236
message you need to take care of it yourself.
237237

238238
To send a message, without expecting a response: >
239-
call sendraw(handle, {string}, 0)
239+
call ch_sendraw(handle, {string}, 0)
240240
The process can send back a response, the channel handler will be called with
241241
it.
242242

243243
To send a message and letting the response handled by a specific function,
244244
asynchronously: >
245-
call sendraw(handle, {string}, {callback})
245+
call ch_sendraw(handle, {string}, {callback})
246246
247247
This {string} can also be JSON, use |jsonencode()| to create it and
248248
|jsondecode()| to handle a received JSON message.

runtime/doc/eval.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*eval.txt* For Vim version 7.4. Last change: 2016 Feb 02
1+
*eval.txt* For Vim version 7.4. Last change: 2016 Feb 04
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -2684,7 +2684,7 @@ ch_open({address}, {mode} [, {callback}]) *ch_open()*
26842684
{callback} is a function that handles received messages on the
26852685
channel. See |channel-callback|.
26862686

2687-
ch_sendexpr({handle}, {expr} [, {callback}]) ch_*sendexpr()*
2687+
ch_sendexpr({handle}, {expr} [, {callback}]) *ch_sendexpr()*
26882688
Send {expr} over JSON channel {handle}. See |channel-use|.
26892689

26902690
When {callback} is given returns immediately. Without

runtime/doc/tags

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5208,6 +5208,10 @@ catch-text eval.txt /*catch-text*
52085208
cc change.txt /*cc*
52095209
ceil() eval.txt /*ceil()*
52105210
ch.vim syntax.txt /*ch.vim*
5211+
ch_close() eval.txt /*ch_close()*
5212+
ch_open() eval.txt /*ch_open()*
5213+
ch_sendexpr() eval.txt /*ch_sendexpr()*
5214+
ch_sendraw() eval.txt /*ch_sendraw()*
52115215
change-list-jumps motion.txt /*change-list-jumps*
52125216
change-name tips.txt /*change-name*
52135217
change-tabs change.txt /*change-tabs*
@@ -5376,7 +5380,6 @@ complex-repeat repeat.txt /*complex-repeat*
53765380
compress pi_gzip.txt /*compress*
53775381
conceal syntax.txt /*conceal*
53785382
confirm() eval.txt /*confirm()*
5379-
connect() eval.txt /*connect()*
53805383
connection-refused message.txt /*connection-refused*
53815384
console-menus gui.txt /*console-menus*
53825385
control intro.txt /*control*
@@ -8011,8 +8014,6 @@ sed.vim syntax.txt /*sed.vim*
80118014
self eval.txt /*self*
80128015
send-money sponsor.txt /*send-money*
80138016
send-to-menu gui_w32.txt /*send-to-menu*
8014-
sendexpr() eval.txt /*sendexpr()*
8015-
sendraw() eval.txt /*sendraw()*
80168017
sendto gui_w32.txt /*sendto*
80178018
sentence motion.txt /*sentence*
80188019
server-functions usr_41.txt /*server-functions*

runtime/doc/todo.txt

Lines changed: 40 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*todo.txt* For Vim version 7.4. Last change: 2016 Feb 01
1+
*todo.txt* For Vim version 7.4. Last change: 2016 Feb 04
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -81,19 +81,36 @@ Regexp problems:
8181
Patch by Christian, 2016 Jan 29.
8282

8383
+channel:
84-
- implement wait for receiving end of Json.
85-
- implement only reading up to end of Json.
84+
- use a timeout for connect()
85+
Patch from Yasuhiro Matsumoto, Feb 2
86+
Change connect() second argument to a dict with items:
87+
mode
88+
timeout
89+
callback
90+
- When receiving malformed json starting with a quote it doesn't get
91+
discarded.
92+
- add ch_setcallback()
93+
- add ch_settimeout()
8694
- cleanup on exit? in mch_getout() and getout().
8795
- Add more contents to channel.txt
8896
- implement debug log
89-
- implement job control
97+
- implement job control:
98+
let job = job_start('command', {options})
99+
call job_stop(job)
100+
let job = job_maystart('command', {address}, {options})
101+
options:
102+
- keep running when Vim exits
103+
- add remark undo sync, is there a way to force it?
90104
- Add a test with a server that can send canned responses.
105+
- Add more testing in json_test.c
91106
- make sure errors lead to a useful error msg. ["ex","foobar"]
92-
- use a timeout for connect() Patch from Yasuhiro Matsumoto, Feb 1
93107
- set timeout for channel.
94108
- implement check for ID in response.
95109
- json: implement UTF-16 surrogate pair.
96110

111+
Patch on #608: (Ken Takata)
112+
https://bitbucket.org/k_takata/vim-ktakata-mq/src/479934b94fd56b064c9e4bd8737585c5df69d56a/fix-gvimext-loadlibrary.patch?fileviewer=file-view-default
113+
97114
This difference is unexpected:
98115
echo v:true == 1
99116
1
@@ -109,6 +126,14 @@ Patch to put undo options together in undo window.
109126
Patch for clearing history. (Yegappan Lakshmanan, 2016 Jan 31, second message
110127
has tests)
111128

129+
Patch to update the GTK icon cache when installing. (Kazunobu Kuriyama, 2016
130+
Feb 3)
131+
132+
Patch for test86 and test87. (Roland Puntaier, #622)
133+
134+
Patch for Python: #622. (Roland Puntaier, 2016 Feb 2)
135+
What does it change?
136+
112137
Need to try out instructions in INSSTALLpc.txt about how to install all
113138
interfaces and how to build Vim with them.
114139
Appveyor build with self-installing executable, includes getting most
@@ -132,6 +157,8 @@ What if there is an invalid character?
132157
Should jsonencode()/jsondecode() restrict recursiveness?
133158
Or avoid recursiveness.
134159

160+
Patch to fix bug in statusline highlighting. (Christian Brabandt, 2016 Feb 2)
161+
135162
Use vim.vim syntax highlighting for help file examples, but without ":" in
136163
'iskeyword' for syntax.
137164

@@ -161,15 +188,16 @@ Patch to avoid redrawing tabline when the popup menu is visible.
161188

162189
Win32: patch to use 64 bit stat() if possible. (Ken Takata, 2014 May 12)
163190
More tests May 14. Update May 29. Update Aug 10.
164-
Now part of large file patches. (Ken Takata, 2016 Jan 19, second one)
165-
Updated patches with ordering: Jan 20.
166-
And another update: Jan 24, then Jan 29, 30, Feb 1.
191+
Now part of large file patches. (Ken Takata, 2016 Feb 1)
192+
Two patches now?
193+
194+
Patch to support 64 bit ints for Number. (Ken Takata, 2016 Jan 21)
167195

168196
7 Add a watchpoint in the debug mode: An expression that breaks execution
169197
when evaluating to non-zero. Add the "watchadd expr" command, stop when
170198
the value of the expression changes. ":watchdel" deletes an item,
171199
":watchlist" lists the items. (Charles Campbell)
172-
Patch by Christian Brabandt, 2016 Jan 27.
200+
Patch by Christian Brabandt, 2016 Feb 1.
173201

174202
Patch to be able to use hex numbers with :digraph. (Lcd, 2015 Sep 6)
175203
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
182210
6, 2nd message)
183211
Alternative: ":keeppos" command modifier: ":keeppos windo {cmd}".
184212

213+
Patch to fix that executable() may fail on very long filename in MS-Windows.
214+
(Ken Takata, 2016 Feb 1)
215+
185216
Patch to fix display of listchars on the cursorline. (Nayuri Aohime, 2013)
186217
Update suggested by Yasuhiro Matsumoto, 2014 Nov 25:
187218
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.
193224
Unexpected delay when using CTRL-O u. It's not timeoutlen.
194225
(Gary Johnson, 2015 Aug 28)
195226

196-
Patch to support 64 bit ints for Number. (Ken Takata, 2016 Jan 21)
197-
198227
Instead of separately uploading patches to the ftp site, we can get them from
199228
github with a URL like this:
200229
https://github.com/vim/vim/compare/v7.4.920%5E...v7.4.920.diff

runtime/doc/usr_41.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*usr_41.txt* For Vim version 7.4. Last change: 2016 Jan 28
1+
*usr_41.txt* For Vim version 7.4. Last change: 2016 Feb 02
22

33
VIM USER MANUAL - by Bram Moolenaar
44

@@ -894,10 +894,10 @@ Testing: *test-functions*
894894
assert_true() assert that an expression is true
895895

896896
Inter-process communication:
897-
connect() open a channel
898-
disconnect() close a channel
899-
sendexpr() send a JSON message over a channel
900-
sendraw() send a raw message over a channel
897+
ch_open() open a channel
898+
ch_close() close a channel
899+
ch_sendexpr() send a JSON message over a channel
900+
ch_sendraw() send a raw message over a channel
901901
jsonencode() encode an expression to a JSON string
902902
jsondecode() decode a JSON string to Vim types
903903

runtime/doc/windows.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*windows.txt* For Vim version 7.4. Last change: 2015 Nov 14
1+
*windows.txt* For Vim version 7.4. Last change: 2016 Feb 01
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -721,7 +721,7 @@ can also get to them with the buffer list commands, like ":bnext".
721721
*:bufdo*
722722
:[range]bufdo[!] {cmd} Execute {cmd} in each buffer in the buffer list or if
723723
[range] is given only for buffers for which their
724-
buffer numer is in the [range]. It works like doing
724+
buffer number is in the [range]. It works like doing
725725
this: >
726726
:bfirst
727727
:{cmd}

runtime/indent/sh.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
" Maintainer: Christian Brabandt <[email protected]>
44
" Previous Maintainer: Peter Aronoff <[email protected]>
55
" Original Author: Nikolai Weibull <[email protected]>
6-
" Latest Revision: 2015-12-15
6+
" Latest Revision: 2016-01-15
77
" License: Vim (see :h license)
88
" Repository: https://github.com/chrisbra/vim-sh-indent
99

@@ -28,7 +28,7 @@ let s:cpo_save = &cpo
2828
set cpo&vim
2929

3030
function s:buffer_shiftwidth()
31-
return &shiftwidth
31+
return shiftwidth()
3232
endfunction
3333

3434
let s:sh_indent_defaults = {

0 commit comments

Comments
 (0)