Skip to content

Commit 328da0d

Browse files
committed
Update runtime files.
1 parent 6300317 commit 328da0d

10 files changed

Lines changed: 408 additions & 160 deletions

File tree

runtime/doc/channel.txt

Lines changed: 41 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*channel.txt* For Vim version 7.4. Last change: 2016 Feb 27
1+
*channel.txt* For Vim version 7.4. Last change: 2016 Mar 03
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -103,6 +103,11 @@ when opening the channel: >
103103
let channel = ch_open('localhost:8765', {'callback': "MyHandler"})
104104
call ch_sendexpr(channel, 'hello!')
105105
106+
When trying out channels it's useful to see what is going on. You can tell
107+
Vim to write lines in log file: >
108+
call ch_logfile('channellog', 'w')
109+
See |ch_logfile()|.
110+
106111
==============================================================================
107112
3. Opening a channel *channel-open*
108113

@@ -130,7 +135,8 @@ Use |ch_status()| to see if the channel could be opened.
130135
overwritten. Therefore set "mode" first and the part specific
131136
mode later.
132137

133-
Note: when writing to a file or buffer NL mode is always used.
138+
Note: when writing to a file or buffer and when reading from a
139+
buffer NL mode is used by default.
134140

135141
*channel-callback*
136142
"callback" A function that is called when a message is received that is
@@ -191,6 +197,10 @@ For example, the handler can be added or changed: >
191197
call ch_setoptions(channel, {'callback': callback})
192198
When "callback" is empty (zero or an empty string) the handler is removed.
193199

200+
After a callback has been invoked Vim will update the screen and put the
201+
cursor back where it belongs. Thus the callback should not need to do
202+
`:redraw`.
203+
194204
The timeout can be changed: >
195205
call ch_setoptions(channel, {'timeout': msec})
196206
<
@@ -259,9 +269,9 @@ message, it must use the number zero:
259269
Then channel handler will then get {response} converted to Vim types. If the
260270
channel does not have a handler the message is dropped.
261271

262-
On read error or ch_close(), when using a socket, the string "DETACH" is sent,
263-
if still possible. The channel will then be inactive. For a JSON and JS mode
264-
channel quotes are used around DETACH, otherwise there are no quotes.
272+
On read error or ch_close(), when using a socket with RAW or NL mode, the
273+
string "DETACH\n" is sent, if still possible. The channel will then be
274+
inactive.
265275

266276
It is also possible to use ch_sendraw() and ch_evalraw() on a JSON or JS
267277
channel. The caller is then completely responsible for correct encoding and
@@ -457,6 +467,22 @@ For example, to start a job and write its output in buffer "dummy": >
457467
\ {'out-io': 'buffer', 'out-name': 'dummy'})
458468
sbuf dummy
459469
470+
To run a job that reads from a buffer: >
471+
let job = job_start({command},
472+
\ {'in-io': 'buffer', 'in-name': 'mybuffer'})
473+
<
474+
*E915* *E918*
475+
The buffer is found by name, similar to |bufnr()|. The buffer must exist and
476+
be loaded when job_start() is called.
477+
478+
By default this reads the whole buffer. This can be changed with the "in-top"
479+
and "in-bot" options.
480+
481+
TODO
482+
A special mode is when "in-top" is set to zero and "in-bot" is not set: The
483+
last-but-one line will be send to the job stdin. This allows for editing the
484+
last line and sending it when pressing Enter.
485+
460486
TODO:
461487
To run a job and read its output once it is done: >
462488
let job = job_start({command}, {'exit-cb': 'MyHandler'})
@@ -470,7 +496,8 @@ To run a job and read its output once it is done: >
470496
9. Starting a job without a channel *job-start-nochannel*
471497

472498
To start another process without creating a channel: >
473-
let job = job_start(command, {"in-io": "null", "out-io": "null"})
499+
let job = job_start(command,
500+
\ {"in-io": "null", "out-io": "null", "err-io": "null"})
474501
475502
This starts {command} in the background, Vim does not wait for it to finish.
476503

@@ -538,7 +565,9 @@ TODO: *job-term*
538565
"in-io": "null" disconnect stdin TODO
539566
"in-io": "pipe" stdin is connected to the channel (default)
540567
"in-io": "file" stdin reads from a file TODO
541-
"in-io": "buffer" stdin reads from a buffer TODO
568+
"in-io": "buffer" stdin reads from a buffer
569+
"in-top": number when using "buffer": first line to send (default: 1)
570+
"in-bot": number when using "buffer": last line to send (default: last)
542571
"in-name": "/path/file" the name of he file or buffer to read from
543572
"in-buf": number the number of the buffer to read from TODO
544573

@@ -551,7 +580,7 @@ TODO: *job-term*
551580
"out-buf": number the number of the buffer to write to TODO
552581

553582
*job-err-io*
554-
"err-io": "out" same as stdout TODO
583+
"err-io": "out" stderr messages to go to stdout
555584
"err-io": "null" disconnect stderr TODO
556585
"err-io": "pipe" stderr is connected to the channel (default)
557586
"err-io": "file" stderr writes to a file TODO
@@ -562,6 +591,10 @@ TODO: *job-term*
562591
When the IO mode is "buffer" and there is a callback, the text is appended to
563592
the buffer before invoking the callback.
564593

594+
When using JS or JSON mode with "buffer", only messages with zero or negative
595+
ID will be added to the buffer, after decoding + encoding. Messages with a
596+
positive number will be handled by a callback, commands are handled as usual.
597+
565598
The name of the buffer is compared the full name of existing buffers. If
566599
there is a match that buffer is used. Otherwise a new buffer is created.
567600
Use an empty name to always create a new buffer. |ch_getbufnr()| can then be

runtime/doc/eval.txt

Lines changed: 11 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 27
1+
*eval.txt* For Vim version 7.4. Last change: 2016 Mar 03
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -2695,6 +2695,14 @@ confirm({msg} [, {choices} [, {default} [, {type}]]])
26952695

26962696
ch_close({channel}) *ch_close()*
26972697
Close {channel}. See |channel-close|.
2698+
2699+
Note that a channel is closed in three stages:
2700+
- The I/O ends, log message: "Closing channel". There can
2701+
still be queued messages to read or callbacks to invoke.
2702+
- The readahead is cleared, log message: "Clearing channel".
2703+
Some variables may still reference the channel.
2704+
- The channel is freed, log message: "Freeing channel".
2705+
26982706
{only available when compiled with the |+channel| feature}
26992707

27002708
ch_evalexpr({channel}, {expr} [, {options}]) *ch_evalexpr()*
@@ -2703,7 +2711,7 @@ ch_evalexpr({channel}, {expr} [, {options}]) *ch_evalexpr()*
27032711
with a raw channel. See |channel-use|.
27042712
*E917*
27052713
{options} must be a Dictionary. It must not have a "callback"
2706-
entry.
2714+
entry. It can have a "timeout" entry.
27072715

27082716
ch_evalexpr() waits for a response and returns the decoded
27092717
expression. When there is an error or timeout it returns an
@@ -2753,6 +2761,7 @@ ch_logfile({fname} [, {mode}]) *ch_logfile()*
27532761
The file is flushed after every message, on Unix you can use
27542762
"tail -f" to see what is going on in real time.
27552763

2764+
27562765
ch_open({address} [, {options}]) *ch_open()*
27572766
Open a channel to {address}. See |channel|.
27582767
Returns a Channel. Use |ch_status()| to check for

runtime/doc/index.txt

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

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1324,7 +1324,6 @@ tag command action ~
13241324
|:lnfile| :lnf[ile] go to first location in next file
13251325
|:lnoremap| :ln[oremap] like ":noremap!" but includes Lang-Arg mode
13261326
|:loadkeymap| :loadk[eymap] load the following keymaps until EOF
1327-
|:loadplugin| :loadp[lugin] load a plugin from 'packpath'
13281327
|:loadview| :lo[adview] load view for current window from a file
13291328
|:lockmarks| :loc[kmarks] following command keeps marks where they are
13301329
|:lockvar| :lockv[ar] lock variables
@@ -1395,6 +1394,7 @@ tag command action ~
13951394
|:ounmap| :ou[nmap] like ":unmap" but for Operator-pending mode
13961395
|:ounmenu| :ounme[nu] remove menu for Operator-pending mode
13971396
|:ownsyntax| :ow[nsyntax] set new local syntax highlight for this window
1397+
|:packadd| :pa[ckadd] add a plugin from 'packpath'
13981398
|:pclose| :pc[lose] close preview window
13991399
|:pedit| :ped[it] edit file in the preview window
14001400
|:perl| :pe[rl] execute Perl command

runtime/doc/repeat.txt

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

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -213,23 +213,31 @@ For writing a Vim script, see chapter 41 of the user manual |usr_41.txt|.
213213
about each searched file.
214214
{not in Vi}
215215

216-
*:loadp* *:loadplugin*
217-
:loadp[lugin] {name} Search for an optional plugin directory and source the
218-
plugin files found. It is similar to: >
219-
:runtime pack/*/opt/{name}/plugin/*.vim
220-
< However, `:loadplugin` uses 'packpath' instead of
221-
'runtimepath'. And the directory found is added to
222-
'runtimepath'.
223-
224-
If you have a directory under 'packpath' that doesn't
225-
actually have a plugin file, just create an empty one.
226-
This will still add the directory to 'runtimepath'.
216+
*:pa* *:packadd*
217+
:pa[ckadd][!] {name} Search for an optional plugin directory in 'packpath'
218+
and source any plugin files found. The directory must
219+
match:
220+
pack/*/opt/{name} ~
221+
The directory is added to 'runtimepath' if it wasn't
222+
there yet.
227223

228224
Note that {name} is the directory name, not the name
229225
of the .vim file. If the "{name}/plugin" directory
230226
contains more than one file they are all sourced.
231227

232-
Also see |load-plugin|.
228+
If the filetype detection was not enabled yet (this
229+
is usually done with a "syntax enable" or "filetype
230+
on" command in your .vimrc file), this will also look
231+
for "{name}/ftdetect/*.vim" files.
232+
233+
When the optional ! is added no plugin files or
234+
ftdetect scripts are loaded, only the matching
235+
directories are added to 'runtimepath'. This is
236+
useful in your .vimrc. The plugins will then be
237+
loaded during initialization, see |load-plugins|.
238+
239+
Also see |pack-add|.
240+
233241

234242
:scripte[ncoding] [encoding] *:scripte* *:scriptencoding* *E167*
235243
Specify the character encoding used in the script.

runtime/doc/starting.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*starting.txt* For Vim version 7.4. Last change: 2016 Feb 27
1+
*starting.txt* For Vim version 7.4. Last change: 2016 Mar 03
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -832,6 +832,8 @@ accordingly. Vim proceeds in this order:
832832
- The user exrc file(s). Same as for the user vimrc file, but with
833833
"vimrc" replaced by "exrc". But only one of ".exrc" and "_exrc" is
834834
used, depending on the system. And without the (*)!
835+
- You would usually have "syntax on" and/or "filetype on" commands,
836+
which trigger initializing filetype detection, see |syntax-loading|.
835837

836838
d. If the 'exrc' option is on (which is not the default), the current
837839
directory is searched for three files. The first that exists is used,

runtime/doc/tags

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2446,8 +2446,6 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
24462446
:lo starting.txt /*:lo*
24472447
:loadk mbyte.txt /*:loadk*
24482448
:loadkeymap mbyte.txt /*:loadkeymap*
2449-
:loadp repeat.txt /*:loadp*
2450-
:loadplugin repeat.txt /*:loadplugin*
24512449
:loadview starting.txt /*:loadview*
24522450
:loc motion.txt /*:loc*
24532451
:lockmarks motion.txt /*:lockmarks*
@@ -2620,6 +2618,8 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
26202618
:ounmenu gui.txt /*:ounmenu*
26212619
:ownsyntax syntax.txt /*:ownsyntax*
26222620
:p various.txt /*:p*
2621+
:pa repeat.txt /*:pa*
2622+
:packadd repeat.txt /*:packadd*
26232623
:pc windows.txt /*:pc*
26242624
:pclose windows.txt /*:pclose*
26252625
:pe if_perl.txt /*:pe*
@@ -4438,8 +4438,10 @@ E911 eval.txt /*E911*
44384438
E912 eval.txt /*E912*
44394439
E913 eval.txt /*E913*
44404440
E914 eval.txt /*E914*
4441+
E915 channel.txt /*E915*
44414442
E916 eval.txt /*E916*
44424443
E917 eval.txt /*E917*
4444+
E918 channel.txt /*E918*
44434445
E92 message.txt /*E92*
44444446
E93 windows.txt /*E93*
44454447
E94 windows.txt /*E94*
@@ -6942,7 +6944,6 @@ list-repeat windows.txt /*list-repeat*
69426944
lite.vim syntax.txt /*lite.vim*
69436945
literal-string eval.txt /*literal-string*
69446946
lnum-variable eval.txt /*lnum-variable*
6945-
load-plugin repeat.txt /*load-plugin*
69466947
load-plugins starting.txt /*load-plugins*
69476948
load-vim-script repeat.txt /*load-vim-script*
69486949
local-additions help.txt /*local-additions*
@@ -7573,6 +7574,7 @@ other-features vi_diff.txt /*other-features*
75737574
out-cb channel.txt /*out-cb*
75747575
out-timeout channel.txt /*out-timeout*
75757576
p change.txt /*p*
7577+
pack-add repeat.txt /*pack-add*
75767578
packages repeat.txt /*packages*
75777579
page-down intro.txt /*page-down*
75787580
page-up intro.txt /*page-up*

runtime/doc/todo.txt

Lines changed: 23 additions & 23 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 27
1+
*todo.txt* For Vim version 7.4. Last change: 2016 Mar 04
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -35,26 +35,22 @@ not be repeated below, unless there is extra information.
3535
-------------------- Known bugs and current work -----------------------
3636

3737
+channel:
38-
- A callback on ch_sendraw() should be put at the end of the list of callback
39-
handlers. When a message arrives invoke the first one and remove it.
4038
- implement TODO items in ":help channel":
39+
- Send last line of buffer when it's added.
4140
- job_start() options:
42-
term
43-
in-io
44-
in-file
45-
out-io
46-
out-file
47-
out-buffer
48-
err-io
49-
err-file
50-
err-buffer
41+
in-io: null, file (in-name), in-buf
42+
out-io: null, file, out-buf
43+
err-io: null, file (err-name), buffer (err-buf)
5144
existing channel to use
5245
- job_maystart()
5346
- add job_info(): process ID, run/dead, etc.
5447
- add ch_info(): in/out/err mode, timeout, callbacks, etc.
5548
- Move more details from eval.txt to channel.txt. Add tags in eval.txt.
5649
- When receiving malformed json starting with a quote it doesn't get
57-
discarded.
50+
discarded. Any invalid JSON or JSON that isn't a list will block further
51+
parsing?
52+
- When decoding json, don't read all the typeahead at once, use the reader
53+
properly.
5854
- When a message in the queue but there is no callback, drop it after a while?
5955
Add timestamp to queued messages and callbacks with ID, remove after a
6056
minute.
@@ -70,12 +66,11 @@ not be repeated below, unless there is extra information.
7066
- make sure errors lead to a useful error msg. ["ex","foobar"]
7167
- For connection to server, a "keep open" flag would be useful. Retry
7268
connecting in the main loop with zero timeout.
69+
Later
70+
- job_start(): run job in a newly opened terminal.
71+
With xterm could use -S{pty}.
7372

74-
For Win32 isinf() should be inline. (ZyX)
75-
76-
Add ":packadd"? Like :loadplugin but only adds the dir to 'runtimepath'.
77-
78-
emoji patch from Yasuhiro Matsumoto.
73+
emoji patch from Yasuhiro Matsumoto. Asked Thomas Dickey.
7974

8075
More plugin support:
8176
- Have a way to install a callback from the main loop. Called every second or
@@ -107,15 +102,17 @@ When running "make install" don't overwrite the doc/tags file, generate it
107102
elsewhere, so that the distributed file doesn't change.
108103

109104
Fix to support --nofork for Windows batch files. (Kevin Cantú, 2016 Feb 23,
110-
#658)
105+
#658, #659) Also add "setlocal" at top of batch file?
111106

112-
Patch to add GTK 3 support. (Kazunobu Kuriyama, 2016 Feb 13)
107+
Patch to add matchstrpos(). (Ozaki Kiichi, 2016 Feb 28)
113108

114109
Why does this: echo "a" . 1.1
115110
result in: a11
116111
Should recognize float (so long as it's not ".1.1").
117112

118-
Allow for an empty dictionary key.
113+
Allow for an empty dictionary key?
114+
115+
Patch to improve I/O for Perl. (Damien, 2016 Jan 9, update Jan 22 2nd one)
119116

120117
Regexp problems:
121118
- The regexp engines are not reentrant, causing havoc when interrupted by a
@@ -170,6 +167,7 @@ Patch to put undo options together in undo window.
170167

171168
Patch to have better check for {action} argument of setqflist().
172169
Nikolai Pavlov, Feb 25, #661. Can be even more strict.
170+
Also see patch from Hirohito Higash, Feb 25.
173171

174172
Patch for clearing history. (Yegappan Lakshmanan, 2016 Jan 31, second message
175173
has tests)
@@ -190,6 +188,10 @@ Two patches now? New update Feb 24.
190188
Patch to support 64 bit ints for Number. (Ken Takata, 2016 Jan 21)
191189
Also in update of Feb 24?
192190

191+
Patch to add setbufline(). (email from Yasuhiro Matsumoto, patch by Ozaki
192+
Kiichi, 2016 Feb 28)
193+
https://gist.github.com/ichizok/64bdc92aed19ec9001dd
194+
193195
Need to try out instructions in INSSTALLpc.txt about how to install all
194196
interfaces and how to build Vim with them.
195197
Appveyor build with self-installing executable, includes getting most
@@ -382,8 +384,6 @@ Patch to add GUI colors to the terminal, when it supports it. (ZyX, 2013 Jan
382384
Patch for problem with restoring screen on Windows. (Nobuhiro Takasaki, 2015
383385
Sep 10)
384386

385-
Patch to improve I/O for Perl. (Damien, 2015 Jan 9, update Jan 22 2nd one)
386-
387387
Patch to set antialiasing style on Windows. (Ondrej Balaz, 2013 Mar 14)
388388
Needs a different check for CLEARTYPE_QUALITY.
389389
Problem mentioned by Christian Brabandt, 2016 Jan 4.

0 commit comments

Comments
 (0)