diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2016-06-20 00:39:46 -0400 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2016-06-20 00:55:41 -0400 |
commit | 8a4e5b4bc23765bf5846f92f438b3721a3076700 (patch) | |
tree | 23c19501cdf1c40d30c9a9291a586d9b83818ff6 /runtime | |
parent | d5ddebe9e23ea60be26b34a02f016194cf8d6874 (diff) | |
parent | 41c0dfd5454702d639d97c44a8fd38cbdd2ff0ba (diff) | |
download | rneovim-8a4e5b4bc23765bf5846f92f438b3721a3076700.tar.gz rneovim-8a4e5b4bc23765bf5846f92f438b3721a3076700.tar.bz2 rneovim-8a4e5b4bc23765bf5846f92f438b3721a3076700.zip |
Merge #4697 'capture() function'.
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/eval.txt | 18 | ||||
-rw-r--r-- | runtime/doc/various.txt | 5 |
2 files changed, 21 insertions, 2 deletions
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index ef2d0ce203..193153e8a3 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1813,6 +1813,7 @@ byteidx({expr}, {nr}) Number byte index of {nr}'th char in {expr} byteidxcomp({expr}, {nr}) Number byte index of {nr}'th char in {expr} call({func}, {arglist} [, {dict}]) any call {func} with arguments {arglist} +capture({command}) String capture output of {command} ceil({expr}) Float round {expr} up changenr() Number current change number char2nr({expr}[, {utf8}]) Number ASCII/UTF8 value of first char in {expr} @@ -2496,6 +2497,23 @@ call({func}, {arglist} [, {dict}]) *call()* *E699* {dict} is for functions with the "dict" attribute. It will be used to set the local variable "self". |Dictionary-function| +capture({command}) *capture()* + Capture output of {command}. + If {command} is a |String|, returns {command} output. + If {command} is a |List|, returns concatenated outputs. + Examples: > + echo capture('echon "foo"') +< foo > + echo capture(['echon "foo"', 'echon "bar"']) +< foobar + This function is not available in the |sandbox|. + Note: {command}s run as if prepended with |:silent| (output is + captured, but not displayed). If multiple capture() calls are + nested, the outer capture() will not catch the command output + of the inner capture(); the inner capture will not cancel the + outer. + Note: Text attributes (highlights) are not captured. + ceil({expr}) *ceil()* Return the smallest integral value greater than or equal to {expr} as a |Float| (round up). diff --git a/runtime/doc/various.txt b/runtime/doc/various.txt index 97c04d54e0..e6b05e1ab1 100644 --- a/runtime/doc/various.txt +++ b/runtime/doc/various.txt @@ -415,8 +415,9 @@ m *+xpm_w32* Win32 GUI only: pixmap support |w32-xpm-support| To stop the messages and commands from being echoed to the screen, put the commands in a function and call it with ":silent call Function()". - An alternative is to use the 'verbosefile' option, - this can be used in combination with ":redir". + Alternatives are the 'verbosefile' option or + |capture()| function, these can be used in combination + with ":redir". :redi[r] >> {file} Redirect messages to file {file}. Append if {file} already exists. |