summaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-02-27 21:10:09 +0100
committerBram Moolenaar <Bram@vim.org>2016-02-27 21:10:09 +0100
commitc7f0ebc6d1e1cdaed816b88a0d6092c5ace615eb (patch)
tree5dc68d43bff1253b9f925123510025dd43884fc7 /runtime
parent136f29a91dbafce424e31a4af133155f997e8f78 (diff)
downloadvim-git-c7f0ebc6d1e1cdaed816b88a0d6092c5ace615eb.tar.gz
patch 7.4.1438v7.4.1438
Problem: Can't get buffer number of a channel. Solution: Add ch_getbufnr().
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/channel.txt11
-rw-r--r--runtime/doc/eval.txt8
2 files changed, 15 insertions, 4 deletions
diff --git a/runtime/doc/channel.txt b/runtime/doc/channel.txt
index 4571258a4..80a269ad1 100644
--- a/runtime/doc/channel.txt
+++ b/runtime/doc/channel.txt
@@ -561,11 +561,14 @@ 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.
- *E915*
+
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,
-where 'buftype' is set to "nofile" and 'bufhidden' to "hide". If you prefer
-other settings, create the buffer first and pass the buffer number.
+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
+used to get the buffer number.
+
+For a new buffer 'buftype' is set to "nofile" and 'bufhidden' to "hide". If
+you prefer other settings, create the buffer first and pass the buffer number.
When the buffer written to is displayed in a window and the cursor is in the
first column of the last line, the cursor will be moved to the newly added
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 6a41c5fe6..b05e59298 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -1822,6 +1822,7 @@ ch_evalexpr( {channel}, {expr} [, {options}])
any evaluate {expr} on JSON {channel}
ch_evalraw( {channel}, {string} [, {options}])
any evaluate {string} on raw {channel}
+ch_getbufnr( {channel}, {what}) Number get buffer number for {channel}/{what}
ch_getjob( {channel}) Job get the Job of {channel}
ch_log( {msg} [, {channel}]) none write {msg} in the channel log file
ch_logfile( {fname} [, {mode}]) none start logging channel activity
@@ -2721,6 +2722,13 @@ ch_evalraw({channel}, {string} [, {options}]) *ch_evalraw()*
{only available when compiled with the |+channel| feature}
+ch_getbufnr({channel}, {what}) *ch_getbufnr()*
+ Get the buffer number that {channel} is using for {what}.
+ {what} can be "err" for stderr, "out" for stdout or empty for
+ socket output.
+ Returns -1 when there is no buffer.
+ {only available when compiled with the |+channel| feature}
+
ch_getjob({channel}) *ch_getjob()*
Get the Job associated with {channel}.
If there is no job calling |job_status()| on the returned Job