summaryrefslogtreecommitdiffstats
path: root/runtime/doc
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-03-04 22:22:32 +0100
committerBram Moolenaar <Bram@vim.org>2016-03-04 22:22:32 +0100
commit328da0dcb7be34b594725eef6dc98d3ea6516d69 (patch)
tree25c1736e833fccd324ea566f527fe42e798fc9a9 /runtime/doc
parent6300317b15eb33409f652c603fb402417fe4eed7 (diff)
Update runtime files.
Diffstat (limited to 'runtime/doc')
-rw-r--r--runtime/doc/channel.txt49
-rw-r--r--runtime/doc/eval.txt13
-rw-r--r--runtime/doc/index.txt4
-rw-r--r--runtime/doc/repeat.txt34
-rw-r--r--runtime/doc/starting.txt4
-rw-r--r--runtime/doc/tags8
-rw-r--r--runtime/doc/todo.txt46
7 files changed, 106 insertions, 52 deletions
diff --git a/runtime/doc/channel.txt b/runtime/doc/channel.txt
index 80a269ad15..0c9f70d3a3 100644
--- 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 27
+*channel.txt* For Vim version 7.4. Last change: 2016 Mar 03
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -103,6 +103,11 @@ when opening the channel: >
let channel = ch_open('localhost:8765', {'callback': "MyHandler"})
call ch_sendexpr(channel, 'hello!')
+When trying out channels it's useful to see what is going on. You can tell
+Vim to write lines in log file: >
+ call ch_logfile('channellog', 'w')
+See |ch_logfile()|.
+
==============================================================================
3. Opening a channel *channel-open*
@@ -130,7 +135,8 @@ Use |ch_status()| to see if the channel could be opened.
overwritten. Therefore set "mode" first and the part specific
mode later.
- Note: when writing to a file or buffer NL mode is always used.
+ Note: when writing to a file or buffer and when reading from a
+ buffer NL mode is used by default.
*channel-callback*
"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: >
call ch_setoptions(channel, {'callback': callback})
When "callback" is empty (zero or an empty string) the handler is removed.
+After a callback has been invoked Vim will update the screen and put the
+cursor back where it belongs. Thus the callback should not need to do
+`:redraw`.
+
The timeout can be changed: >
call ch_setoptions(channel, {'timeout': msec})
<
@@ -259,9 +269,9 @@ 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(), when using a socket, the string "DETACH" is sent,
-if still possible. The channel will then be inactive. For a JSON and JS mode
-channel quotes are used around DETACH, otherwise there are no quotes.
+On read error or ch_close(), when using a socket with RAW or NL mode, the
+string "DETACH\n" is sent, if still possible. The channel will then be
+inactive.
It is also possible to use ch_sendraw() and ch_evalraw() on a JSON or JS
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": >
\ {'out-io': 'buffer', 'out-name': 'dummy'})
sbuf dummy
+To run a job that reads from a buffer: >
+ let job = job_start({command},
+ \ {'in-io': 'buffer', 'in-name': 'mybuffer'})
+<
+ *E915* *E918*
+The buffer is found by name, similar to |bufnr()|. The buffer must exist and
+be loaded when job_start() is called.
+
+By default this reads the whole buffer. This can be changed with the "in-top"
+and "in-bot" options.
+
+TODO
+A special mode is when "in-top" is set to zero and "in-bot" is not set: The
+last-but-one line will be send to the job stdin. This allows for editing the
+last line and sending it when pressing Enter.
+
TODO:
To run a job and read its output once it is done: >
let job = job_start({command}, {'exit-cb': 'MyHandler'})
@@ -470,7 +496,8 @@ To run a job and read its output once it is done: >
9. Starting a job without a channel *job-start-nochannel*
To start another process without creating a channel: >
- let job = job_start(command, {"in-io": "null", "out-io": "null"})
+ let job = job_start(command,
+ \ {"in-io": "null", "out-io": "null", "err-io": "null"})
This starts {command} in the background, Vim does not wait for it to finish.
@@ -538,7 +565,9 @@ TODO: *job-term*
"in-io": "null" disconnect stdin TODO
"in-io": "pipe" stdin is connected to the channel (default)
"in-io": "file" stdin reads from a file TODO
-"in-io": "buffer" stdin reads from a buffer TODO
+"in-io": "buffer" stdin reads from a buffer
+"in-top": number when using "buffer": first line to send (default: 1)
+"in-bot": number when using "buffer": last line to send (default: last)
"in-name": "/path/file" the name of he file or buffer to read from
"in-buf": number the number of the buffer to read from TODO
@@ -551,7 +580,7 @@ TODO: *job-term*
"out-buf": number the number of the buffer to write to TODO
*job-err-io*
-"err-io": "out" same as stdout TODO
+"err-io": "out" stderr messages to go to stdout
"err-io": "null" disconnect stderr TODO
"err-io": "pipe" stderr is connected to the channel (default)
"err-io": "file" stderr writes to a file TODO
@@ -562,6 +591,10 @@ TODO: *job-term*
When the IO mode is "buffer" and there is a callback, the text is appended to
the buffer before invoking the callback.
+When using JS or JSON mode with "buffer", only messages with zero or negative
+ID will be added to the buffer, after decoding + encoding. Messages with a
+positive number will be handled by a callback, commands are handled as usual.
+
The name of the buffer is compared the full name of existing buffers. If
there is a match that buffer is used. Otherwise a new buffer is created.
Use an empty name to always create a new buffer. |ch_getbufnr()| can then be
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 4b672bbb55..7693ee399e 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -1,4 +1,4 @@
-*eval.txt* For Vim version 7.4. Last change: 2016 Feb 27
+*eval.txt* For Vim version 7.4. Last change: 2016 Mar 03
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -2695,6 +2695,14 @@ confirm({msg} [, {choices} [, {default} [, {type}]]])
ch_close({channel}) *ch_close()*
Close {channel}. See |channel-close|.
+
+ Note that a channel is closed in three stages:
+ - The I/O ends, log message: "Closing channel". There can
+ still be queued messages to read or callbacks to invoke.
+ - The readahead is cleared, log message: "Clearing channel".
+ Some variables may still reference the channel.
+ - The channel is freed, log message: "Freeing channel".
+
{only available when compiled with the |+channel| feature}
ch_evalexpr({channel}, {expr} [, {options}]) *ch_evalexpr()*
@@ -2703,7 +2711,7 @@ ch_evalexpr({channel}, {expr} [, {options}]) *ch_evalexpr()*
with a raw channel. See |channel-use|.
*E917*
{options} must be a Dictionary. It must not have a "callback"
- entry.
+ entry. It can have a "timeout" entry.
ch_evalexpr() waits for a response and returns the decoded
expression. When there is an error or timeout it returns an
@@ -2753,6 +2761,7 @@ ch_logfile({fname} [, {mode}]) *ch_logfile()*
The file is flushed after every message, on Unix you can use
"tail -f" to see what is going on in real time.
+
ch_open({address} [, {options}]) *ch_open()*
Open a channel to {address}. See |channel|.
Returns a Channel. Use |ch_status()| to check for
diff --git a/runtime/doc/index.txt b/runtime/doc/index.txt
index 581ee36cc8..88abdd9f72 100644
--- a/runtime/doc/index.txt
+++ b/runtime/doc/index.txt
@@ -1,4 +1,4 @@
-*index.txt* For Vim version 7.4. Last change: 2016 Feb 27
+*index.txt* For Vim version 7.4. Last change: 2016 Mar 04
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1324,7 +1324,6 @@ tag command action ~
|:lnfile| :lnf[ile] go to first location in next file
|:lnoremap| :ln[oremap] like ":noremap!" but includes Lang-Arg mode
|:loadkeymap| :loadk[eymap] load the following keymaps until EOF
-|:loadplugin| :loadp[lugin] load a plugin from 'packpath'
|:loadview| :lo[adview] load view for current window from a file
|:lockmarks| :loc[kmarks] following command keeps marks where they are
|:lockvar| :lockv[ar] lock variables
@@ -1395,6 +1394,7 @@ tag command action ~
|:ounmap| :ou[nmap] like ":unmap" but for Operator-pending mode
|:ounmenu| :ounme[nu] remove menu for Operator-pending mode
|:ownsyntax| :ow[nsyntax] set new local syntax highlight for this window
+|:packadd| :pa[ckadd] add a plugin from 'packpath'
|:pclose| :pc[lose] close preview window
|:pedit| :ped[it] edit file in the preview window
|:perl| :pe[rl] execute Perl command
diff --git a/runtime/doc/repeat.txt b/runtime/doc/repeat.txt
index 4a25f8d485..d5d78638ae 100644
--- a/runtime/doc/repeat.txt
+++ b/runtime/doc/repeat.txt
@@ -1,4 +1,4 @@
-*repeat.txt* For Vim version 7.4. Last change: 2016 Feb 26
+*repeat.txt* For Vim version 7.4. Last change: 2016 Mar 04
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|.
about each searched file.
{not in Vi}
- *:loadp* *:loadplugin*
-:loadp[lugin] {name} Search for an optional plugin directory and source the
- plugin files found. It is similar to: >
- :runtime pack/*/opt/{name}/plugin/*.vim
-< However, `:loadplugin` uses 'packpath' instead of
- 'runtimepath'. And the directory found is added to
- 'runtimepath'.
-
- If you have a directory under 'packpath' that doesn't
- actually have a plugin file, just create an empty one.
- This will still add the directory to 'runtimepath'.
+ *:pa* *:packadd*
+:pa[ckadd][!] {name} Search for an optional plugin directory in 'packpath'
+ and source any plugin files found. The directory must
+ match:
+ pack/*/opt/{name} ~
+ The directory is added to 'runtimepath' if it wasn't
+ there yet.
Note that {name} is the directory name, not the name
of the .vim file. If the "{name}/plugin" directory
contains more than one file they are all sourced.
- Also see |load-plugin|.
+ If the filetype detection was not enabled yet (this
+ is usually done with a "syntax enable" or "filetype
+ on" command in your .vimrc file), this will also look
+ for "{name}/ftdetect/*.vim" files.
+
+ When the optional ! is added no plugin files or
+ ftdetect scripts are loaded, only the matching
+ directories are added to 'runtimepath'. This is
+ useful in your .vimrc. The plugins will then be
+ loaded during initialization, see |load-plugins|.
+
+ Also see |pack-add|.
+
:scripte[ncoding] [encoding] *:scripte* *:scriptencoding* *E167*
Specify the character encoding used in the script.
diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt
index c982a99f6e..450fdaf17a 100644
--- a/runtime/doc/starting.txt
+++ b/runtime/doc/starting.txt
@@ -1,4 +1,4 @@
-*starting.txt* For Vim version 7.4. Last change: 2016 Feb 27
+*starting.txt* For Vim version 7.4. Last change: 2016 Mar 03
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -832,6 +832,8 @@ accordingly. Vim proceeds in this order:
- The user exrc file(s). Same as for the user vimrc file, but with
"vimrc" replaced by "exrc". But only one of ".exrc" and "_exrc" is
used, depending on the system. And without the (*)!
+ - You would usually have "syntax on" and/or "filetype on" commands,
+ which trigger initializing filetype detection, see |syntax-loading|.
d. If the 'exrc' option is on (which is not the default), the current
directory is searched for three files. The first that exists is used,
diff --git a/runtime/doc/tags b/runtime/doc/tags
index 061bc31955..8e822c6f39 100644
--- a/runtime/doc/tags
+++ b/runtime/doc/tags
@@ -2446,8 +2446,6 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
:lo starting.txt /*:lo*
:loadk mbyte.txt /*:loadk*
:loadkeymap mbyte.txt /*:loadkeymap*
-:loadp repeat.txt /*:loadp*
-:loadplugin repeat.txt /*:loadplugin*
:loadview starting.txt /*:loadview*
:loc motion.txt /*:loc*
:lockmarks motion.txt /*:lockmarks*
@@ -2620,6 +2618,8 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
:ounmenu gui.txt /*:ounmenu*
:ownsyntax syntax.txt /*:ownsyntax*
:p various.txt /*:p*
+:pa repeat.txt /*:pa*
+:packadd repeat.txt /*:packadd*
:pc windows.txt /*:pc*
:pclose windows.txt /*:pclose*
:pe if_perl.txt /*:pe*
@@ -4438,8 +4438,10 @@ E911 eval.txt /*E911*
E912 eval.txt /*E912*
E913 eval.txt /*E913*
E914 eval.txt /*E914*
+E915 channel.txt /*E915*
E916 eval.txt /*E916*
E917 eval.txt /*E917*
+E918 channel.txt /*E918*
E92 message.txt /*E92*
E93 windows.txt /*E93*
E94 windows.txt /*E94*
@@ -6942,7 +6944,6 @@ list-repeat windows.txt /*list-repeat*
lite.vim syntax.txt /*lite.vim*
literal-string eval.txt /*literal-string*
lnum-variable eval.txt /*lnum-variable*
-load-plugin repeat.txt /*load-plugin*
load-plugins starting.txt /*load-plugins*
load-vim-script repeat.txt /*load-vim-script*
local-additions help.txt /*local-additions*
@@ -7573,6 +7574,7 @@ other-features vi_diff.txt /*other-features*
out-cb channel.txt /*out-cb*
out-timeout channel.txt /*out-timeout*
p change.txt /*p*
+pack-add repeat.txt /*pack-add*
packages repeat.txt /*packages*
page-down intro.txt /*page-down*
page-up intro.txt /*page-up*
diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt
index ecfc9e5170..5fed9ac608 100644
--- a/runtime/doc/todo.txt
+++ b/runtime/doc/todo.txt
@@ -1,4 +1,4 @@
-*todo.txt* For Vim version 7.4. Last change: 2016 Feb 27
+*todo.txt* For Vim version 7.4. Last change: 2016 Mar 04
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -35,26 +35,22 @@ not be repeated below, unless there is extra information.
-------------------- Known bugs and current work -----------------------
+channel:
-- A callback on ch_sendraw() should be put at the end of the list of callback
- handlers. When a message arrives invoke the first one and remove it.
- implement TODO items in ":help channel":
+ - Send last line of buffer when it's added.
- job_start() options:
- term
- in-io
- in-file
- out-io
- out-file
- out-buffer
- err-io
- err-file
- err-buffer
+ in-io: null, file (in-name), in-buf
+ out-io: null, file, out-buf
+ err-io: null, file (err-name), buffer (err-buf)
existing channel to use
- job_maystart()
- add job_info(): process ID, run/dead, etc.
- add ch_info(): in/out/err mode, timeout, callbacks, etc.
- Move more details from eval.txt to channel.txt. Add tags in eval.txt.
- When receiving malformed json starting with a quote it doesn't get
- discarded.
+ discarded. Any invalid JSON or JSON that isn't a list will block further
+ parsing?
+- When decoding json, don't read all the typeahead at once, use the reader
+ properly.
- When a message in the queue but there is no callback, drop it after a while?
Add timestamp to queued messages and callbacks with ID, remove after a
minute.
@@ -70,12 +66,11 @@ not be repeated below, unless there is extra information.
- make sure errors lead to a useful error msg. ["ex","foobar"]
- For connection to server, a "keep open" flag would be useful. Retry
connecting in the main loop with zero timeout.
+Later
+- job_start(): run job in a newly opened terminal.
+ With xterm could use -S{pty}.
-For Win32 isinf() should be inline. (ZyX)
-
-Add ":packadd"? Like :loadplugin but only adds the dir to 'runtimepath'.
-
-emoji patch from Yasuhiro Matsumoto.
+emoji patch from Yasuhiro Matsumoto. Asked Thomas Dickey.
More plugin support:
- 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
elsewhere, so that the distributed file doesn't change.
Fix to support --nofork for Windows batch files. (Kevin CantĂș, 2016 Feb 23,
-#658)
+#658, #659) Also add "setlocal" at top of batch file?
-Patch to add GTK 3 support. (Kazunobu Kuriyama, 2016 Feb 13)
+Patch to add matchstrpos(). (Ozaki Kiichi, 2016 Feb 28)
Why does this: echo "a" . 1.1
result in: a11
Should recognize float (so long as it's not ".1.1").
-Allow for an empty dictionary key.
+Allow for an empty dictionary key?
+
+Patch to improve I/O for Perl. (Damien, 2016 Jan 9, update Jan 22 2nd one)
Regexp problems:
- 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.
Patch to have better check for {action} argument of setqflist().
Nikolai Pavlov, Feb 25, #661. Can be even more strict.
+Also see patch from Hirohito Higash, Feb 25.
Patch for clearing history. (Yegappan Lakshmanan, 2016 Jan 31, second message
has tests)
@@ -190,6 +188,10 @@ Two patches now? New update Feb 24.
Patch to support 64 bit ints for Number. (Ken Takata, 2016 Jan 21)
Also in update of Feb 24?
+Patch to add setbufline(). (email from Yasuhiro Matsumoto, patch by Ozaki
+Kiichi, 2016 Feb 28)
+https://gist.github.com/ichizok/64bdc92aed19ec9001dd
+
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
@@ -382,8 +384,6 @@ Patch to add GUI colors to the terminal, when it supports it. (ZyX, 2013 Jan
Patch for problem with restoring screen on Windows. (Nobuhiro Takasaki, 2015
Sep 10)
-Patch to improve I/O for Perl. (Damien, 2015 Jan 9, update Jan 22 2nd one)
-
Patch to set antialiasing style on Windows. (Ondrej Balaz, 2013 Mar 14)
Needs a different check for CLEARTYPE_QUALITY.
Problem mentioned by Christian Brabandt, 2016 Jan 4.