Skip to content

Commit 1e35e3e

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents 312c032 + 8038568 commit 1e35e3e

17 files changed

Lines changed: 359 additions & 148 deletions

runtime/doc/autocmd.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*autocmd.txt* For Vim version 7.4. Last change: 2015 Dec 05
1+
*autocmd.txt* For Vim version 7.4. Last change: 2016 Mar 26
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar

runtime/doc/channel.txt

Lines changed: 63 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*channel.txt* For Vim version 7.4. Last change: 2016 Mar 15
1+
*channel.txt* For Vim version 7.4. Last change: 2016 Mar 26
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -120,24 +120,13 @@ Use |ch_status()| to see if the channel could be opened.
120120

121121
{address} has the form "hostname:port". E.g., "localhost:8765".
122122

123-
{options} is a dictionary with optional entries:
123+
{options} is a dictionary with optional entries: *channel-open-options*
124124

125125
"mode" can be: *channel-mode*
126126
"json" - Use JSON, see below; most convenient way. Default.
127127
"js" - Use JS (JavaScript) encoding, more efficient than JSON.
128128
"nl" - Use messages that end in a NL character
129129
"raw" - Use raw messages
130-
*in_mode* *out_mode* *err_mode*
131-
"in_mode" mode specifically for stdin, only when using pipes
132-
"out_mode" mode specifically for stdout, only when using pipes
133-
"err_mode" mode specifically for stderr, only when using pipes
134-
Note: when setting "mode" the part specific mode is
135-
overwritten. Therefore set "mode" first and the part specific
136-
mode later.
137-
138-
Note: when writing to a file or buffer and when reading from a
139-
buffer NL mode is used by default.
140-
141130
*channel-callback* *E921*
142131
"callback" A function that is called when a message is received that is
143132
not handled otherwise. It gets two arguments: the channel
@@ -155,16 +144,8 @@ Use |ch_status()| to see if the channel could be opened.
155144
as a string.
156145

157146
For all callbacks: Use |function()| to bind it to arguments
158-
and/or a dictionary.
159-
*out_cb*
160-
"out_cb" A function like "callback" but used for stdout. Only for when
161-
the channel uses pipes. When "out_cb" wasn't set the channel
162-
callback is used.
163-
*err_cb*
164-
"err_cb" A function like "callback" but used for stderr. Only for when
165-
the channel uses pipes. When "err_cb" wasn't set the channel
166-
callback is used.
167-
147+
and/or a Dictionary. Or use the form "dict.function" to bind
148+
the Dictionary.
168149
*close_cb*
169150
"close_cb" A function that is called when the channel gets closed, other
170151
than by calling ch_close(). It should be defined like this: >
@@ -178,16 +159,10 @@ Use |ch_status()| to see if the channel could be opened.
178159
actually uses a 1 msec timeout, that is required on many
179160
systems. Use a larger value for a remote server, e.g. 10
180161
msec at least.
181-
162+
*channel-timeout*
182163
"timeout" The time to wait for a request when blocking, E.g. when using
183164
ch_evalexpr(). In milliseconds. The default is 2000 (2
184165
seconds).
185-
*out_timeout* *err_timeout*
186-
"out_timeout" Timeout for stdout. Only when using pipes.
187-
"err_timeout" Timeout for stderr. Only when using pipes.
188-
Note: when setting "timeout" the part specific mode is
189-
overwritten. Therefore set "timeout" first and the part
190-
specific mode later.
191166

192167
When "mode" is "json" or "js" the "callback" is optional. When omitted it is
193168
only possible to receive a message after sending one.
@@ -215,6 +190,13 @@ pipes are used (stdin/stdout/stderr) they are all closed. This might not be
215190
what you want! Stopping the job with job_stop() might be better.
216191
All readahead is discarded, callbacks will no longer be invoked.
217192

193+
Note that a channel is closed in three stages:
194+
- The I/O ends, log message: "Closing channel". There can still be queued
195+
messages to read or callbacks to invoke.
196+
- The readahead is cleared, log message: "Clearing channel". Some variables
197+
may still reference the channel.
198+
- The channel is freed, log message: "Freeing channel".
199+
218200
When the channel can't be opened you will get an error message. There is a
219201
difference between MS-Windows and Unix: On Unix when the port doesn't exist
220202
ch_open() fails quickly. On MS-Windows "waittime" applies.
@@ -326,6 +308,9 @@ completion or error. You could use functions in an |autoload| script:
326308

327309
You can also use "call |feedkeys()|" to insert any key sequence.
328310

311+
When there is an error a message is written to the channel log, if it exists,
312+
and v:errmsg is set to the error.
313+
329314

330315
Command "normal" ~
331316

@@ -428,6 +413,23 @@ To read all output from a RAW channel that is available: >
428413
To read the error output: >
429414
let output = ch_readraw(channel, {"part": "err"})
430415
416+
ch_read() and ch_readraw() use the channel timeout. When there is nothing to
417+
read within that time an empty string is returned. To specify a different
418+
timeout in msec use the "timeout" option:
419+
{"timeout": 123} ~
420+
To read from the error output use the "part" option:
421+
{"part": "err"} ~
422+
To read a message with a specific ID, on a JS or JSON channel:
423+
{"id": 99} ~
424+
When no ID is specified or the ID is -1, the first message is returned. This
425+
overrules any callback waiting for this message.
426+
427+
For a RAW channel this returns whatever is available, since Vim does not know
428+
where a message ends.
429+
For a NL channel this returns one message.
430+
For a JS or JSON channel this returns one decoded message.
431+
This includes any sequence number.
432+
431433
==============================================================================
432434
8. Starting a job with a channel *job-start* *job*
433435

@@ -524,15 +526,31 @@ job_setoptions(job, {options}). Many options can be used with the channel
524526
related to the job, using ch_setoptions(channel, {options}).
525527
See |job_setoptions()| and |ch_setoptions()|.
526528

529+
*in_mode* *out_mode* *err_mode*
530+
"in_mode" mode specifically for stdin, only when using pipes
531+
"out_mode" mode specifically for stdout, only when using pipes
532+
"err_mode" mode specifically for stderr, only when using pipes
533+
See |channel-mode| for the values.
534+
535+
Note: when setting "mode" the part specific mode is
536+
overwritten. Therefore set "mode" first and the part
537+
specific mode later.
538+
539+
Note: when writing to a file or buffer and when
540+
reading from a buffer NL mode is used by default.
541+
527542
*job-callback*
528543
"callback": handler Callback for something to read on any part of the
529544
channel.
530-
*job-out_cb*
545+
*job-out_cb* *out_cb*
531546
"out_cb": handler Callback for when there is something to read on
532-
stdout.
533-
*job-err_cb*
547+
stdout. Only for when the channel uses pipes. When
548+
"out_cb" wasn't set the channel callback is used.
549+
550+
*job-err_cb* *err_cb*
534551
"err_cb": handler Callback for when there is something to read on
535-
stderr.
552+
stderr. Only for when the channel uses pipes. When
553+
"err_cb" wasn't set the channel callback is used.
536554
*job-close_cb*
537555
"close_cb": handler Callback for when the channel is closed. Same as
538556
"close_cb" on ch_open().
@@ -542,6 +560,17 @@ See |job_setoptions()| and |ch_setoptions()|.
542560
Vim checks about every 10 seconds for jobs that ended.
543561
The callback can also be triggered by calling
544562
|job_status()|.
563+
*job-timeout*
564+
"timeout" The time to wait for a request when blocking, E.g.
565+
when using ch_evalexpr(). In milliseconds. The
566+
default is 2000 (2 seconds).
567+
*out_timeout* *err_timeout*
568+
"out_timeout" Timeout for stdout. Only when using pipes.
569+
"err_timeout" Timeout for stderr. Only when using pipes.
570+
Note: when setting "timeout" the part specific mode is
571+
overwritten. Therefore set "timeout" first and the
572+
part specific mode later.
573+
545574
*job-stoponexit*
546575
"stoponexit": {signal} Send {signal} to the job when Vim exits. See
547576
|job_stop()| for possible values.

runtime/doc/eval.txt

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

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1805,6 +1805,7 @@ assert_equal( {exp}, {act} [, {msg}]) none assert {exp} equals {act}
18051805
assert_exception( {error} [, {msg}]) none assert {error} is in v:exception
18061806
assert_fails( {cmd} [, {error}]) none assert {cmd} fails
18071807
assert_false( {actual} [, {msg}]) none assert {actual} is false
1808+
assert_match( {pat}, {text} [, {msg}]) none assert {pat} matches {text}
18081809
assert_true( {actual} [, {msg}]) none assert {actual} is true
18091810
asin( {expr}) Float arc sine of {expr}
18101811
atan( {expr}) Float arc tangent of {expr}
@@ -2315,6 +2316,26 @@ assert_false({actual} [, {msg}]) *assert_false()*
23152316
When {msg} is omitted an error in the form "Expected False but
23162317
got {actual}" is produced.
23172318

2319+
*assert_match()*
2320+
assert_match({pattern}, {actual} [, {msg}])
2321+
When {pattern} does not match {actual} an error message is
2322+
added to |v:errors|.
2323+
2324+
{pattern} is used as with |=~|: The matching is always done
2325+
like 'magic' was set and 'cpoptions' is empty, no matter what
2326+
the actual value of 'magic' or 'cpoptions' is.
2327+
2328+
{actual} is used as a string, automatic conversion applies.
2329+
Use "^" and "$" to match with the start and end of the text.
2330+
Use both to match the whole text.
2331+
2332+
When {msg} is omitted an error in the form "Pattern {pattern}
2333+
does not match {actual}" is produced.
2334+
Example: >
2335+
assert_match('^f.*o$', 'foobar')
2336+
< Will result in a string to be added to |v:errors|:
2337+
test.vim line 12: Pattern '^f.*o$' does not match 'foobar' ~
2338+
23182339
assert_true({actual} [, {msg}]) *assert_true()*
23192340
When {actual} is not true an error message is added to
23202341
|v:errors|, like with |assert_equal()|.
@@ -2716,13 +2737,6 @@ ch_close({handle}) *ch_close()*
27162737
Close {handle}. See |channel-close|.
27172738
{handle} can be Channel or a Job that has a Channel.
27182739

2719-
Note that a channel is closed in three stages:
2720-
- The I/O ends, log message: "Closing channel". There can
2721-
still be queued messages to read or callbacks to invoke.
2722-
- The readahead is cleared, log message: "Clearing channel".
2723-
Some variables may still reference the channel.
2724-
- The channel is freed, log message: "Freeing channel".
2725-
27262740
{only available when compiled with the |+channel| feature}
27272741

27282742
ch_evalexpr({handle}, {expr} [, {options}]) *ch_evalexpr()*
@@ -2732,7 +2746,8 @@ ch_evalexpr({handle}, {expr} [, {options}]) *ch_evalexpr()*
27322746
{handle} can be Channel or a Job that has a Channel.
27332747
*E917*
27342748
{options} must be a Dictionary. It must not have a "callback"
2735-
entry. It can have a "timeout" entry.
2749+
entry. It can have a "timeout" entry to specify the timeout
2750+
for this specific request.
27362751

27372752
ch_evalexpr() waits for a response and returns the decoded
27382753
expression. When there is an error or timeout it returns an
@@ -2816,65 +2831,34 @@ ch_logfile({fname} [, {mode}]) *ch_logfile()*
28162831

28172832
ch_open({address} [, {options}]) *ch_open()*
28182833
Open a channel to {address}. See |channel|.
2819-
Returns a Channel. Use |ch_status()| to check for
2820-
failure.
2834+
Returns a Channel. Use |ch_status()| to check for failure.
28212835

28222836
{address} has the form "hostname:port", e.g.,
28232837
"localhost:8765".
28242838

2825-
If {options} is given it must be a |Dictionary|. The optional
2826-
items are:
2827-
mode "raw", "js" or "json".
2828-
Default "json".
2829-
callback function to call for requests with a zero
2830-
sequence number. See |channel-callback|.
2831-
Default: none.
2832-
waittime Specify connect timeout as milliseconds.
2833-
Negative means forever.
2834-
Default: 0 (don't wait)
2835-
timeout Specify response read timeout value in
2836-
milliseconds.
2837-
Default: 2000.
2839+
If {options} is given it must be a |Dictionary|.
2840+
See |channel-open-options|.
2841+
28382842
{only available when compiled with the |+channel| feature}
28392843

28402844
ch_read({handle} [, {options}]) *ch_read()*
28412845
Read from {handle} and return the received message.
28422846
{handle} can be Channel or a Job that has a Channel.
2843-
2844-
This uses the channel timeout. When there is nothing to read
2845-
within that time an empty string is returned. To specify a
2846-
different timeout in msec use the "timeout" option:
2847-
{"timeout": 123} ~
2848-
To read from the error output use the "part" option:
2849-
{"part": "err"} ~
2850-
To read a message with a specific ID, on a JS or JSON channel:
2851-
{"id": 99} ~
2852-
When no ID is specified or the ID is -1, the first message is
2853-
returned. This overrules any callback waiting for this
2854-
message.
2855-
2856-
For a RAW channel this returns whatever is available, since
2857-
Vim does not know where a message ends.
2858-
For a NL channel this returns one message.
2859-
For a JS or JSON channel this returns one decoded message.
2860-
This includes any sequence number.
2847+
See |channel-more|.
2848+
{only available when compiled with the |+channel| feature}
28612849

28622850
ch_readraw({handle} [, {options}]) *ch_readraw()*
28632851
Like ch_read() but for a JS and JSON channel does not decode
2864-
the message.
2852+
the message. See |channel-more|.
2853+
{only available when compiled with the |+channel| feature}
28652854

28662855
ch_sendexpr({handle}, {expr} [, {options}]) *ch_sendexpr()*
28672856
Send {expr} over {handle}. The {expr} is encoded
28682857
according to the type of channel. The function cannot be used
2869-
with a raw channel. See |channel-use|. *E912*
2858+
with a raw channel.
2859+
See |channel-use|. *E912*
28702860
{handle} can be Channel or a Job that has a Channel.
28712861

2872-
{options} must be a Dictionary. The "callback" item is a
2873-
Funcref or the name of a function it is invoked when the
2874-
response is received. See |channel-callback|.
2875-
Without "callback" the channel handler is invoked, otherwise
2876-
any received message is dropped.
2877-
28782862
{only available when compiled with the |+channel| feature}
28792863

28802864
ch_sendraw({handle}, {string} [, {options}]) *ch_sendraw()*
@@ -6675,13 +6659,17 @@ string({expr}) Return {expr} converted to a String. If {expr} is a Number,
66756659
Float, String or a composition of them, then the result can be
66766660
parsed back with |eval()|.
66776661
{expr} type result ~
6678-
String 'string'
6662+
String 'string' (single quotes are doubled)
66796663
Number 123
66806664
Float 123.123456 or 1.123456e8
66816665
Funcref function('name')
66826666
List [item, item]
66836667
Dictionary {key: value, key: value}
6684-
Note that in String values the ' character is doubled.
6668+
6669+
When a List or Dictionary has a recursive reference it is
6670+
replaced by "[...]" or "{...}". Using eval() on the result
6671+
will then fail.
6672+
66856673
Also see |strtrans()|.
66866674

66876675
*strlen()*
@@ -7669,6 +7657,7 @@ unix Unix version of Vim.
76697657
user_commands User-defined commands.
76707658
vertsplit Compiled with vertically split windows |:vsplit|.
76717659
vim_starting True while initial source'ing takes place. |startup|
7660+
*vim_starting*
76727661
viminfo Compiled with viminfo support.
76737662
virtualedit Compiled with 'virtualedit' option.
76747663
visual Compiled with Visual mode.

runtime/doc/helphelp.txt

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

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -208,9 +208,11 @@ command: >
208208
sorted.
209209
When there are duplicates an error message is given.
210210
An existing tags file is silently overwritten.
211+
211212
The optional "++t" argument forces adding the
212213
"help-tags" tag. This is also done when the {dir} is
213214
equal to $VIMRUNTIME/doc.
215+
214216
To rebuild the help tags in the runtime directory
215217
(requires write permission there): >
216218
:helptags $VIMRUNTIME/doc

runtime/doc/options.txt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*options.txt* For Vim version 7.4. Last change: 2016 Mar 19
1+
*options.txt* For Vim version 7.4. Last change: 2016 Mar 24
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -2305,6 +2305,8 @@ A jump table for the options with a short description can be found at |Q_op|.
23052305
different. The whole undo file is encrypted, not just
23062306
the pieces of text.
23072307

2308+
You should use "blowfish2", also to re-encrypt older files.
2309+
23082310
When reading an encrypted file 'cryptmethod' will be set automatically
23092311
to the detected method of the file being read. Thus if you write it
23102312
without changing 'cryptmethod' the same method will be used.
@@ -3043,8 +3045,8 @@ A jump table for the options with a short description can be found at |Q_op|.
30433045
file only, the option is not changed.
30443046
When 'binary' is set, the value of 'fileformats' is not used.
30453047

3046-
Note that when Vim starts up with an empty buffer this option is not
3047-
used. Set 'fileformat' in your .vimrc instead.
3048+
When Vim starts up with an empty buffer the first item is used. You
3049+
can overrule this by setting 'fileformat' in your .vimrc.
30483050

30493051
For systems with a Dos-like <EOL> (<CR><NL>), when reading files that
30503052
are ":source"ed and for vimrc files, automatic <EOL> detection may be
@@ -5251,6 +5253,7 @@ A jump table for the options with a short description can be found at |Q_op|.
52515253
written. A ":set nomodified" command also resets the original
52525254
values to the current values and the 'modified' option will be
52535255
reset.
5256+
Similarly for 'eol' and 'bomb'.
52545257
This option is not set when a change is made to the buffer as the
52555258
result of a BufNewFile, BufRead/BufReadPost, BufWritePost,
52565259
FileAppendPost or VimLeave autocommand event. See |gzip-example| for

0 commit comments

Comments
 (0)