diff options
Diffstat (limited to 'runtime')
| -rw-r--r-- | runtime/doc/builtin.txt | 63 | ||||
| -rw-r--r-- | runtime/doc/news.txt | 5 | ||||
| -rw-r--r-- | runtime/doc/ui.txt | 5 |
3 files changed, 49 insertions, 24 deletions
diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index b74e30db09..568b73ddfa 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -359,7 +359,8 @@ pyxeval({expr}) any evaluate |python_x| expression rand([{expr}]) Number get pseudo-random number range({expr} [, {max} [, {stride}]]) List items from {expr} to {max} -readblob({fname}) Blob read a |Blob| from {fname} +readblob({fname} [, {offset} [, {size}]]) + Blob read a |Blob| from {fname} readdir({dir} [, {expr}]) List file names in {dir} selected by {expr} readfile({fname} [, {type} [, {max}]]) List get list of lines from file {fname} @@ -3867,6 +3868,7 @@ has({feature}) Returns 1 if {feature} is supported, 0 otherwise. The clipboard |clipboard| provider is available. fname_case Case in file names matters (for Darwin and MS-Windows this is not present). + gui_running Nvim has a GUI. iconv Can use |iconv()| for conversion. linux Linux system. mac MacOS system. @@ -6109,6 +6111,25 @@ pyxeval({expr}) *pyxeval()* Can also be used as a |method|: > GetExpr()->pyxeval() < +rand([{expr}]) *rand()* + Return a pseudo-random Number generated with an xoshiro128** + algorithm using seed {expr}. The returned number is 32 bits, + also on 64 bits systems, for consistency. + {expr} can be initialized by |srand()| and will be updated by + rand(). If {expr} is omitted, an internal seed value is used + and updated. + Returns -1 if {expr} is invalid. + + Examples: > + :echo rand() + :let seed = srand() + :echo rand(seed) + :echo rand(seed) % 16 " random number 0 - 15 +< + Can also be used as a |method|: > + seed->rand() +< + *E726* *E727* range({expr} [, {max} [, {stride}]]) *range()* Returns a |List| with Numbers: @@ -6131,29 +6152,29 @@ range({expr} [, {max} [, {stride}]]) *range()* Can also be used as a |method|: > GetExpr()->range() < -rand([{expr}]) *rand()* - Return a pseudo-random Number generated with an xoshiro128** - algorithm using seed {expr}. The returned number is 32 bits, - also on 64 bits systems, for consistency. - {expr} can be initialized by |srand()| and will be updated by - rand(). If {expr} is omitted, an internal seed value is used - and updated. - Returns -1 if {expr} is invalid. - Examples: > - :echo rand() - :let seed = srand() - :echo rand(seed) - :echo rand(seed) % 16 " random number 0 - 15 -< - Can also be used as a |method|: > - seed->rand() -< - -readblob({fname}) *readblob()* +readblob({fname} [, {offset} [, {size}]]) *readblob()* Read file {fname} in binary mode and return a |Blob|. - When the file can't be opened an error message is given and + If {offset} is specified, read the file from the specified + offset. If it is a negative value, it is used as an offset + from the end of the file. E.g., to read the last 12 bytes: > + readblob('file.bin', -12) +< If {size} is specified, only the specified size will be read. + E.g. to read the first 100 bytes of a file: > + readblob('file.bin', 0, 100) +< If {size} is -1 or omitted, the whole data starting from + {offset} will be read. + This can be also used to read the data from a character device + on Unix when {size} is explicitly set. Only if the device + supports seeking {offset} can be used. Otherwise it should be + zero. E.g. to read 10 bytes from a serial console: > + readblob('/dev/ttyS0', 0, 10) +< When the file can't be opened an error message is given and the result is an empty |Blob|. + When the offset is beyond the end of the file the result is an + empty blob. + When trying to read more bytes than are available the result + is truncated. Also see |readfile()| and |writefile()|. diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt index c5261b739d..90e17d3678 100644 --- a/runtime/doc/news.txt +++ b/runtime/doc/news.txt @@ -179,6 +179,11 @@ The following new APIs or features were added. Additionally |TSNode:range()| now takes an optional {include_bytes} argument. +• |nvim_list_uis()| reports all |ui-option| fields. + +• Vim's `has('gui_running')` is now supported as a way for plugins to check if + a GUI (not the |TUI|) is attached to Nvim. |has()| + ============================================================================== CHANGED FEATURES *news-changes* diff --git a/runtime/doc/ui.txt b/runtime/doc/ui.txt index bb567e021e..e706e36374 100644 --- a/runtime/doc/ui.txt +++ b/runtime/doc/ui.txt @@ -53,9 +53,8 @@ with these (optional) keys: - `term_name` Sets the name of the terminal 'term'. - `term_colors` Sets the number of supported colors 't_Co'. - `term_background` Sets the default value of 'background'. -- `stdin_fd` Read buffer from `fd` as if it was a stdin pipe. - This option can only used by |--embed| ui on startup. - See |ui-startup-stdin|. +- `stdin_fd` Read buffer 1 from this fd as if it were stdin |--|. + Only from |--embed| UI on startup. |ui-startup-stdin| - `stdin_tty` Tells if `stdin` is a `tty` or not. - `stdout_tty` Tells if `stdout` is a `tty` or not. |