Mercurial > vim
comparison runtime/doc/eval.txt @ 11211:71311d899b42 v8.0.0492
patch 8.0.0492: a failing client-server request can make Vim hang
commit https://github.com/vim/vim/commit/81b9d0bd5c705815e903e671e81b0b05828efd9c
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Mar 19 21:20:53 2017 +0100
patch 8.0.0492: a failing client-server request can make Vim hang
Problem: A failing client-server request can make Vim hang.
Solution: Add a timeout argument to functions that wait.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 19 Mar 2017 21:30:05 +0100 |
parents | 13544aa85dc0 |
children | d3415ec1cdaf |
comparison
equal
deleted
inserted
replaced
11210:5ffe3a7f9bd7 | 11211:71311d899b42 |
---|---|
6318 echo split(reltimestr(reltime(start)))[0] | 6318 echo split(reltimestr(reltime(start)))[0] |
6319 < Also see |profiling|. | 6319 < Also see |profiling|. |
6320 {only available when compiled with the |+reltime| feature} | 6320 {only available when compiled with the |+reltime| feature} |
6321 | 6321 |
6322 *remote_expr()* *E449* | 6322 *remote_expr()* *E449* |
6323 remote_expr({server}, {string} [, {idvar}]) | 6323 remote_expr({server}, {string} [, {idvar} [, {timeout}]]) |
6324 Send the {string} to {server}. The string is sent as an | 6324 Send the {string} to {server}. The string is sent as an |
6325 expression and the result is returned after evaluation. | 6325 expression and the result is returned after evaluation. |
6326 The result must be a String or a |List|. A |List| is turned | 6326 The result must be a String or a |List|. A |List| is turned |
6327 into a String by joining the items with a line break in | 6327 into a String by joining the items with a line break in |
6328 between (not at the end), like with join(expr, "\n"). | 6328 between (not at the end), like with join(expr, "\n"). |
6329 If {idvar} is present, it is taken as the name of a | 6329 If {idvar} is present and not empty, it is taken as the name |
6330 variable and a {serverid} for later use with | 6330 of a variable and a {serverid} for later use with |
6331 remote_read() is stored there. | 6331 remote_read() is stored there. |
6332 If {timeout} is given the read times out after this many | |
6333 seconds. Otherwise a timeout of 600 seconds is used. | |
6332 See also |clientserver| |RemoteReply|. | 6334 See also |clientserver| |RemoteReply|. |
6333 This function is not available in the |sandbox|. | 6335 This function is not available in the |sandbox|. |
6334 {only available when compiled with the |+clientserver| feature} | 6336 {only available when compiled with the |+clientserver| feature} |
6335 Note: Any errors will cause a local error message to be issued | 6337 Note: Any errors will cause a local error message to be issued |
6336 and the result will be the empty string. | 6338 and the result will be the empty string. |
6365 {only available when compiled with the |+clientserver| feature} | 6367 {only available when compiled with the |+clientserver| feature} |
6366 Examples: > | 6368 Examples: > |
6367 :let repl = "" | 6369 :let repl = "" |
6368 :echo "PEEK: ".remote_peek(id, "repl").": ".repl | 6370 :echo "PEEK: ".remote_peek(id, "repl").": ".repl |
6369 | 6371 |
6370 remote_read({serverid}) *remote_read()* | 6372 remote_read({serverid}, [{timeout}]) *remote_read()* |
6371 Return the oldest available reply from {serverid} and consume | 6373 Return the oldest available reply from {serverid} and consume |
6372 it. It blocks until a reply is available. | 6374 it. Unless a {timeout} in seconds is given, it blocks until a |
6375 reply is available. | |
6373 See also |clientserver|. | 6376 See also |clientserver|. |
6374 This function is not available in the |sandbox|. | 6377 This function is not available in the |sandbox|. |
6375 {only available when compiled with the |+clientserver| feature} | 6378 {only available when compiled with the |+clientserver| feature} |
6376 Example: > | 6379 Example: > |
6377 :echo remote_read(id) | 6380 :echo remote_read(id) |