comparison 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
comparison
equal deleted inserted replaced
10232:95c9ab5b97fc 10233:d709622a18c9
2029 any send {expr} over JSON {handle} 2029 any send {expr} over JSON {handle}
2030 ch_sendraw({handle}, {string} [, {options}]) 2030 ch_sendraw({handle}, {string} [, {options}])
2031 any send {string} over raw {handle} 2031 any send {string} over raw {handle}
2032 ch_setoptions({handle}, {options}) 2032 ch_setoptions({handle}, {options})
2033 none set options for {handle} 2033 none set options for {handle}
2034 ch_status({handle}) String status of channel {handle} 2034 ch_status({handle} [, {options}])
2035 String status of channel {handle}
2035 changenr() Number current change number 2036 changenr() Number current change number
2036 char2nr({expr}[, {utf8}]) Number ASCII/UTF8 value of first char in {expr} 2037 char2nr({expr}[, {utf8}]) Number ASCII/UTF8 value of first char in {expr}
2037 cindent({lnum}) Number C indent for line {lnum} 2038 cindent({lnum}) Number C indent for line {lnum}
2038 clearmatches() none clear all matches 2039 clearmatches() none clear all matches
2039 col({expr}) Number column nr of cursor or mark 2040 col({expr}) Number column nr of cursor or mark
3040 3041
3041 ch_info({handle}) *ch_info()* 3042 ch_info({handle}) *ch_info()*
3042 Returns a Dictionary with information about {handle}. The 3043 Returns a Dictionary with information about {handle}. The
3043 items are: 3044 items are:
3044 "id" number of the channel 3045 "id" number of the channel
3045 "status" "open" (any part is open) or "closed" 3046 "status" "open", "buffered" or "closed", like
3047 ch_status()
3046 When opened with ch_open(): 3048 When opened with ch_open():
3047 "hostname" the hostname of the address 3049 "hostname" the hostname of the address
3048 "port" the port of the address 3050 "port" the port of the address
3049 "sock_status" "open" or "closed" 3051 "sock_status" "open" or "closed"
3050 "sock_mode" "NL", "RAW", "JSON" or "JS" 3052 "sock_mode" "NL", "RAW", "JSON" or "JS"
3051 "sock_io" "socket" 3053 "sock_io" "socket"
3052 "sock_timeout" timeout in msec 3054 "sock_timeout" timeout in msec
3053 When opened with job_start(): 3055 When opened with job_start():
3054 "out_status" "open" or "closed" 3056 "out_status" "open", "buffered" or "closed"
3055 "out_mode" "NL", "RAW", "JSON" or "JS" 3057 "out_mode" "NL", "RAW", "JSON" or "JS"
3056 "out_io" "null", "pipe", "file" or "buffer" 3058 "out_io" "null", "pipe", "file" or "buffer"
3057 "out_timeout" timeout in msec 3059 "out_timeout" timeout in msec
3058 "err_status" "open" or "closed" 3060 "err_status" "open", "buffered" or "closed"
3059 "err_mode" "NL", "RAW", "JSON" or "JS" 3061 "err_mode" "NL", "RAW", "JSON" or "JS"
3060 "err_io" "out", "null", "pipe", "file" or "buffer" 3062 "err_io" "out", "null", "pipe", "file" or "buffer"
3061 "err_timeout" timeout in msec 3063 "err_timeout" timeout in msec
3062 "in_status" "open" or "closed" 3064 "in_status" "open" or "closed"
3063 "in_mode" "NL", "RAW", "JSON" or "JS" 3065 "in_mode" "NL", "RAW", "JSON" or "JS"
3138 lost. 3140 lost.
3139 3141
3140 These options cannot be changed: 3142 These options cannot be changed:
3141 "waittime" only applies to |ch_open()| 3143 "waittime" only applies to |ch_open()|
3142 3144
3143 ch_status({handle}) *ch_status()* 3145 ch_status({handle} [, {options}]) *ch_status()*
3144 Return the status of {handle}: 3146 Return the status of {handle}:
3145 "fail" failed to open the channel 3147 "fail" failed to open the channel
3146 "open" channel can be used 3148 "open" channel can be used
3147 "buffered" channel can be read, not written to 3149 "buffered" channel can be read, not written to
3148 "closed" channel can not be used 3150 "closed" channel can not be used
3149 {handle} can be Channel or a Job that has a Channel. 3151 {handle} can be Channel or a Job that has a Channel.
3150 "buffered" is used when the channel was closed but there is 3152 "buffered" is used when the channel was closed but there is
3151 still data that can be obtained with |ch_read()|. 3153 still data that can be obtained with |ch_read()|.
3152 3154
3155 If {options} is given it can contain a "part" entry to specify
3156 the part of the channel to return the status for: "out" or
3157 "err". For example, to get the error status: >
3158 ch_status(job, {"part": "err"})
3159 <
3153 *copy()* 3160 *copy()*
3154 copy({expr}) Make a copy of {expr}. For Numbers and Strings this isn't 3161 copy({expr}) Make a copy of {expr}. For Numbers and Strings this isn't
3155 different from using {expr} directly. 3162 different from using {expr} directly.
3156 When {expr} is a |List| a shallow copy is created. This means 3163 When {expr} is a |List| a shallow copy is created. This means
3157 that the original |List| can be changed without changing the 3164 that the original |List| can be changed without changing the