Mercurial > vim
comparison runtime/doc/eval.txt @ 8285:e05e28dcb590 v7.4.1435
commit https://github.com/vim/vim/commit/8b1862a31639becadcbbca5dc2eaa92db73e8e5f
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Feb 27 19:21:24 2016 +0100
patch 7.4.1435
Problem: It is confusing that ch_sendexpr() and ch_sendraw() wait for a
response.
Solution: Add ch_evalexpr() and ch_evalraw().
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 27 Feb 2016 19:30:04 +0100 |
parents | ff900e499f79 |
children | ac0c43e7af20 |
comparison
equal
deleted
inserted
replaced
8284:ded553b5751a | 8285:e05e28dcb590 |
---|---|
1816 byteidxcomp( {expr}, {nr}) Number byte index of {nr}'th char in {expr} | 1816 byteidxcomp( {expr}, {nr}) Number byte index of {nr}'th char in {expr} |
1817 call( {func}, {arglist} [, {dict}]) | 1817 call( {func}, {arglist} [, {dict}]) |
1818 any call {func} with arguments {arglist} | 1818 any call {func} with arguments {arglist} |
1819 ceil( {expr}) Float round {expr} up | 1819 ceil( {expr}) Float round {expr} up |
1820 ch_close( {channel}) none close {channel} | 1820 ch_close( {channel}) none close {channel} |
1821 ch_evalexpr( {channel}, {expr} [, {options}]) | |
1822 any evaluate {expr} on JSON {channel} | |
1823 ch_evalraw( {channel}, {string} [, {options}]) | |
1824 any evaluate {string} on raw {channel} | |
1821 ch_getjob( {channel}) Job get the Job of {channel} | 1825 ch_getjob( {channel}) Job get the Job of {channel} |
1822 ch_log( {msg} [, {channel}]) none write {msg} in the channel log file | 1826 ch_log( {msg} [, {channel}]) none write {msg} in the channel log file |
1823 ch_logfile( {fname} [, {mode}]) none start logging channel activity | 1827 ch_logfile( {fname} [, {mode}]) none start logging channel activity |
1824 ch_open( {address} [, {options}]) Channel open a channel to {address} | 1828 ch_open( {address} [, {options}]) Channel open a channel to {address} |
1825 ch_read( {channel} [, {options}]) String read from {channel} | 1829 ch_read( {channel} [, {options}]) String read from {channel} |
2690 | 2694 |
2691 ch_close({channel}) *ch_close()* | 2695 ch_close({channel}) *ch_close()* |
2692 Close {channel}. See |channel-close|. | 2696 Close {channel}. See |channel-close|. |
2693 {only available when compiled with the |+channel| feature} | 2697 {only available when compiled with the |+channel| feature} |
2694 | 2698 |
2699 ch_evalexpr({channel}, {expr} [, {options}]) *ch_evalexpr()* | |
2700 Send {expr} over {channel}. The {expr} is encoded | |
2701 according to the type of channel. The function cannot be used | |
2702 with a raw channel. See |channel-use|. *E912* | |
2703 *E917* | |
2704 {options} must be a Dictionary. It must not have a "callback" | |
2705 entry. | |
2706 | |
2707 ch_evalexpr() waits for a response and returns the decoded | |
2708 expression. When there is an error or timeout it returns an | |
2709 empty string. | |
2710 | |
2711 {only available when compiled with the |+channel| feature} | |
2712 | |
2713 ch_evalraw({channel}, {string} [, {options}]) *ch_evalraw()* | |
2714 Send {string} over {channel}. | |
2715 Works like |ch_evalexpr()|, but does not encode the request or | |
2716 decode the response. The caller is responsible for the | |
2717 correct contents. Also does not add a newline for a channel | |
2718 in NL mode, the caller must do that. The NL in the response | |
2719 is removed. | |
2720 See |channel-use|. | |
2721 | |
2722 {only available when compiled with the |+channel| feature} | |
2723 | |
2695 ch_getjob({channel}) *ch_getjob()* | 2724 ch_getjob({channel}) *ch_getjob()* |
2696 Get the Job associated with {channel}. | 2725 Get the Job associated with {channel}. |
2697 If there is no job calling |job_status()| on the returned Job | 2726 If there is no job calling |job_status()| on the returned Job |
2698 will result in "fail". | 2727 will result in "fail". |
2699 | 2728 |
2767 ch_sendexpr({channel}, {expr} [, {options}]) *ch_sendexpr()* | 2796 ch_sendexpr({channel}, {expr} [, {options}]) *ch_sendexpr()* |
2768 Send {expr} over {channel}. The {expr} is encoded | 2797 Send {expr} over {channel}. The {expr} is encoded |
2769 according to the type of channel. The function cannot be used | 2798 according to the type of channel. The function cannot be used |
2770 with a raw channel. See |channel-use|. *E912* | 2799 with a raw channel. See |channel-use|. *E912* |
2771 | 2800 |
2772 {options} must be a Dictionary. | 2801 {options} must be a Dictionary. The "callback" item is a |
2773 When "callback" is a Funcref or the name of a function, | 2802 Funcref or the name of a function it is invoked when the |
2774 ch_sendexpr() returns immediately. The callback is invoked | 2803 response is received. See |channel-callback|. |
2775 when the response is received. See |channel-callback|. | 2804 Without "callback" the channel handler is invoked, otherwise |
2776 | 2805 any received message is dropped. |
2777 Without "callback" ch_sendexpr() waits for a response and | |
2778 returns the decoded expression. When there is an error or | |
2779 timeout it returns an empty string. | |
2780 | |
2781 When "callback" is zero no response is expected. | |
2782 | 2806 |
2783 {only available when compiled with the |+channel| feature} | 2807 {only available when compiled with the |+channel| feature} |
2784 | 2808 |
2785 ch_sendraw({channel}, {string} [, {options}]) *ch_sendraw()* | 2809 ch_sendraw({channel}, {string} [, {options}]) *ch_sendraw()* |
2786 Send {string} over {channel}. | 2810 Send {string} over {channel}. |
7389 ruby Compiled with Ruby interface |ruby|. | 7413 ruby Compiled with Ruby interface |ruby|. |
7390 scrollbind Compiled with 'scrollbind' support. | 7414 scrollbind Compiled with 'scrollbind' support. |
7391 showcmd Compiled with 'showcmd' support. | 7415 showcmd Compiled with 'showcmd' support. |
7392 signs Compiled with |:sign| support. | 7416 signs Compiled with |:sign| support. |
7393 smartindent Compiled with 'smartindent' support. | 7417 smartindent Compiled with 'smartindent' support. |
7394 sniff Compiled with SNiFF interface support. | |
7395 spell Compiled with spell checking support |spell|. | 7418 spell Compiled with spell checking support |spell|. |
7396 startuptime Compiled with |--startuptime| support. | 7419 startuptime Compiled with |--startuptime| support. |
7397 statusline Compiled with support for 'statusline', 'rulerformat' | 7420 statusline Compiled with support for 'statusline', 'rulerformat' |
7398 and special formats of 'titlestring' and 'iconstring'. | 7421 and special formats of 'titlestring' and 'iconstring'. |
7399 sun_workshop Compiled with support for Sun |workshop|. | 7422 sun_workshop Compiled with support for Sun |workshop|. |