Home Explore Blog CI



neovim

22th chunk of `runtime/doc/api.txt`
529c156068fd09c1032759b91214b410a7ccca15e6215c170000000100000fcb
                              *nvim__id_dict()*
    Returns dict given as argument.

    This API function is used for testing. One should not rely on its presence
    in plugins.

    Parameters: ~
      • {dct}  Dict to return.

    Return: ~
        its argument.

nvim__id_float({flt})                                       *nvim__id_float()*
    Returns floating-point value given as argument.

    This API function is used for testing. One should not rely on its presence
    in plugins.

    Parameters: ~
      • {flt}  Value to return.

    Return: ~
        its argument.

nvim__inspect_cell({grid}, {row}, {col})                *nvim__inspect_cell()*
    NB: if your UI doesn't use hlstate, this will not return hlstate first
    time.

nvim__invalidate_glyph_cache()                *nvim__invalidate_glyph_cache()*
    For testing. The condition in schar_cache_clear_if_full is hard to reach,
    so this function can be used to force a cache clear in a test.

nvim__redraw({opts})                                          *nvim__redraw()*
    EXPERIMENTAL: this API may change in the future.

    Instruct Nvim to redraw various components.

    Attributes: ~
        Since: 0.10.0

    Parameters: ~
      • {opts}  Optional parameters.
                • win: Target a specific |window-ID| as described below.
                • buf: Target a specific buffer number as described below.
                • flush: Update the screen with pending updates.
                • valid: When present mark `win`, `buf`, or all windows for
                  redraw. When `true`, only redraw changed lines (useful for
                  decoration providers). When `false`, forcefully redraw.
                • range: Redraw a range in `buf`, the buffer in `win` or the
                  current buffer (useful for decoration providers). Expects a
                  tuple `[first, last]` with the first and last line number of
                  the range, 0-based end-exclusive |api-indexing|.
                • cursor: Immediately update cursor position on the screen in
                  `win` or the current window.
                • statuscolumn: Redraw the 'statuscolumn' in `buf`, `win` or
                  all windows.
                • statusline: Redraw the 'statusline' in `buf`, `win` or all
                  windows.
                • winbar: Redraw the 'winbar' in `buf`, `win` or all windows.
                • tabline: Redraw the 'tabline'.

    See also: ~
      • |:redraw|

nvim__stats()                                                  *nvim__stats()*
    Gets internal stats.

    Return: ~
        Map of various internal stats.


==============================================================================
Vimscript Functions                                            *api-vimscript*

                                                   *nvim_call_dict_function()*
nvim_call_dict_function({dict}, {fn}, {args})
    Calls a Vimscript |Dictionary-function| with the given arguments.

    On execution error: fails with Vimscript error, updates v:errmsg.

    Attributes: ~
        Since: 0.3.0

    Parameters: ~
      • {dict}  Dict, or String evaluating to a Vimscript |self| dict
      • {fn}    Name of the function defined on the Vimscript dict
      • {args}  Function arguments packed in an Array

    Return: ~
        Result of the function call

nvim_call_function({fn}, {args})                        *nvim_call_function()*
    Calls a Vimscript function with the given arguments.

    On execution error: fails with Vimscript error, updates v:errmsg.

    Attributes: ~
        Since: 0.1.0

    Parameters: ~
      • {fn}    Function to call
      • {args}  Function arguments packed in an Array

    Return: ~
        Result of the function call

nvim_command({command})                                       *nvim_command()*
    Executes an Ex command.

    On execution error: fails with Vimscript error, updates v:errmsg.

    Prefer |nvim_cmd()| or |nvim_exec2()|

Title: Nvim API: Testing Functions, Redraw, Stats, and Vimscript Function Calls
Summary
This section documents the Nvim API functions for various testing purposes, including functions to return a given dictionary or float (`nvim__id_dict`, `nvim__id_float`), inspect a cell (`nvim__inspect_cell`), invalidate the glyph cache (`nvim__invalidate_glyph_cache`), and instruct Nvim to redraw components (`nvim__redraw`). It also details `nvim__stats` for obtaining internal stats and functions for calling Vimscript functions (`nvim_call_dict_function`, `nvim_call_function`) and executing Ex commands (`nvim_command`).