aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc/api.txt
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/doc/api.txt')
-rw-r--r--runtime/doc/api.txt47
1 files changed, 30 insertions, 17 deletions
diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt
index 812208ca31..3ab7c77056 100644
--- a/runtime/doc/api.txt
+++ b/runtime/doc/api.txt
@@ -442,6 +442,9 @@ to disable various visual features such as the 'number' column.
Currently, floating windows don't support some widgets like scrollbar.
+The output of |:mksession| does not include commands for restoring floating
+windows.
+
Example: create a float with scratch buffer: >
let buf = nvim_create_buf(v:false, v:true)
@@ -844,8 +847,11 @@ nvim_eval_statusline({str}, {*opts}) *nvim_eval_statusline()*
Treated as single-width even if it isn't.
• highlights: (boolean) Return highlight
information.
+ • use_winbar: (boolean) Evaluate winbar instead of
+ statusline.
• use_tabline: (boolean) Evaluate tabline instead
of statusline. When |TRUE|, {winid} is ignored.
+ Mutually exclusive with {use_winbar}.
Return: ~
Dictionary containing statusline information, with these
@@ -1668,12 +1674,18 @@ nvim_set_option_value({name}, {value}, {*opts})
global and local value are set unless otherwise specified with
{scope}.
+ Note the options {win} and {buf} cannot be used together.
+
Parameters: ~
{name} Option name
{value} New option value
{opts} Optional parameters
• scope: One of 'global' or 'local'. Analogous to
|:setglobal| and |:setlocal|, respectively.
+ • win: |window-ID|. Used for setting window local
+ option.
+ • buf: Buffer number. Used for setting buffer
+ local option.
nvim_set_var({name}, {value}) *nvim_set_var()*
Sets a global (g:) variable.
@@ -1725,8 +1737,7 @@ Vimscript Functions *api-vimscript*
nvim_call_dict_function({dict}, {fn}, {args})
Calls a VimL |Dictionary-function| with the given arguments.
- On execution error: fails with VimL error, does not update
- v:errmsg.
+ On execution error: fails with VimL error, updates v:errmsg.
Parameters: ~
{dict} Dictionary, or String evaluating to a VimL |self|
@@ -1740,8 +1751,7 @@ nvim_call_dict_function({dict}, {fn}, {args})
nvim_call_function({fn}, {args}) *nvim_call_function()*
Calls a VimL function with the given arguments.
- On execution error: fails with VimL error, does not update
- v:errmsg.
+ On execution error: fails with VimL error, updates v:errmsg.
Parameters: ~
{fn} Function to call
@@ -1760,6 +1770,8 @@ nvim_cmd({*cmd}, {*opts}) *nvim_cmd()*
argument, expanding filenames in a command that otherwise
doesn't expand filenames, etc.
+ On execution error: fails with VimL error, updates v:errmsg.
+
Parameters: ~
{cmd} Command to execute. Must be a Dictionary that can
contain the same values as the return value of
@@ -1781,8 +1793,7 @@ nvim_cmd({*cmd}, {*opts}) *nvim_cmd()*
nvim_command({command}) *nvim_command()*
Executes an Ex command.
- On execution error: fails with VimL error, does not update
- v:errmsg.
+ On execution error: fails with VimL error, updates v:errmsg.
Prefer using |nvim_cmd()| or |nvim_exec()| over this. To
evaluate multiple lines of Vim script or an Ex command
@@ -1798,8 +1809,7 @@ nvim_eval({expr}) *nvim_eval()*
Evaluates a VimL |expression|. Dictionaries and Lists are
recursively expanded.
- On execution error: fails with VimL error, does not update
- v:errmsg.
+ On execution error: fails with VimL error, updates v:errmsg.
Parameters: ~
{expr} VimL expression string
@@ -1814,8 +1824,7 @@ nvim_exec({src}, {output}) *nvim_exec()*
Unlike |nvim_command()| this function supports heredocs,
script-scope (s:), etc.
- On execution error: fails with VimL error, does not update
- v:errmsg.
+ On execution error: fails with VimL error, updates v:errmsg.
Parameters: ~
{src} Vimscript code
@@ -2656,13 +2665,12 @@ nvim_buf_get_extmarks({buffer}, {ns_id}, {start}, {end}, {opts})
nvim_buf_set_extmark({buffer}, {ns_id}, {line}, {col}, {*opts})
Creates or updates an extmark.
- To create a new extmark, pass id=0. The extmark id will be
- returned. To move an existing mark, pass its id.
-
- It is also allowed to create a new mark by passing in a
- previously unused id, but the caller must then keep track of
- existing and unused ids itself. (Useful over RPC, to avoid
- waiting for the return value.)
+ By default a new extmark is created when no id is passed in,
+ but it is also possible to create a new mark by passing in a
+ previously unused id or move an existing mark by passing in
+ its id. The caller must then keep track of existing and unused
+ ids itself. (Useful over RPC, to avoid waiting for the return
+ value.)
Using the optional arguments, it is possible to use this to
highlight a range of text, and also to associate virtual text
@@ -3469,6 +3477,8 @@ nvim_create_autocmd({event}, {*opts}) *nvim_create_autocmd()*
• buf: (number) the expanded value of |<abuf>|
• file: (string) the expanded value of
|<afile>|
+ • data: (any) arbitrary data passed to
+ |nvim_exec_autocmds()|
• command (string) optional: Vim command to
execute on event. Cannot be used with
@@ -3544,6 +3554,9 @@ nvim_exec_autocmds({event}, {*opts}) *nvim_exec_autocmds()*
• modeline (bool) optional: defaults to true.
Process the modeline after the autocommands
|<nomodeline>|.
+ • data (any): arbitrary data to send to the
+ autocommand callback. See
+ |nvim_create_autocmd()| for details.
See also: ~
|:doautocmd|