diff runtime/doc/eval.txt @ 10233:d709622a18c9 v8.0.0015

commit https://github.com/vim/vim/commit/7ef3810d28b7ab2edbfcafab3fe8ad8bc2c2f138 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Sep 26 22:36:58 2016 +0200 patch 8.0.0015 Problem: Can't tell which part of a channel has "buffered" status. Solution: Add an optional argument to ch_status(). Let ch_info() also return "buffered" for out_status and err_status.
author Christian Brabandt <cb@256bit.org>
date Mon, 26 Sep 2016 22:45:05 +0200
parents 8a1481e59d64
children 197795e3530d
line wrap: on
line diff
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -2031,7 +2031,8 @@ ch_sendraw({handle}, {string} [, {option
 				any	send {string} over raw {handle}
 ch_setoptions({handle}, {options})
 				none	set options for {handle}
-ch_status({handle})		String	status of channel {handle}
+ch_status({handle} [, {options}])
+				String	status of channel {handle}
 changenr()			Number	current change number
 char2nr({expr}[, {utf8}])	Number	ASCII/UTF8 value of first char in {expr}
 cindent({lnum})			Number	C indent for line {lnum}
@@ -3042,7 +3043,8 @@ ch_info({handle})						*ch_info()*
 		Returns a Dictionary with information about {handle}.  The
 		items are:
 		   "id"		  number of the channel
-		   "status"	  "open" (any part is open) or "closed"
+		   "status"	  "open", "buffered" or "closed", like
+				  ch_status()
 		When opened with ch_open():
 		   "hostname"	  the hostname of the address
 		   "port"	  the port of the address
@@ -3051,11 +3053,11 @@ ch_info({handle})						*ch_info()*
 		   "sock_io"	  "socket"
 		   "sock_timeout" timeout in msec
 		When opened with job_start():
-		   "out_status"	  "open" or "closed"
+		   "out_status"	  "open", "buffered" or "closed"
 		   "out_mode"	  "NL", "RAW", "JSON" or "JS"
 		   "out_io"	  "null", "pipe", "file" or "buffer"
 		   "out_timeout"  timeout in msec
-		   "err_status"	  "open" or "closed"
+		   "err_status"	  "open", "buffered" or "closed"
 		   "err_mode"	  "NL", "RAW", "JSON" or "JS"
 		   "err_io"	  "out", "null", "pipe", "file" or "buffer"
 		   "err_timeout"  timeout in msec
@@ -3140,7 +3142,7 @@ ch_setoptions({handle}, {options})			*ch
 		These options cannot be changed:
 			"waittime"	only applies to |ch_open()|
 
-ch_status({handle})						*ch_status()*
+ch_status({handle} [, {options}])				*ch_status()*
 		Return the status of {handle}:
 			"fail"		failed to open the channel
 			"open"		channel can be used
@@ -3150,6 +3152,11 @@ ch_status({handle})						*ch_status()*
 		"buffered" is used when the channel was closed but there is
 		still data that can be obtained with |ch_read()|.
 
+		If {options} is given it can contain a "part" entry to specify
+		the part of the channel to return the status for: "out" or
+		"err".  For example, to get the error status: >
+			ch_status(job, {"part": "err"})
+<
 							*copy()*
 copy({expr})	Make a copy of {expr}.  For Numbers and Strings this isn't
 		different from using {expr} directly.