Home Explore Blog CI



neovim

40th chunk of `runtime/doc/api.txt`
008c15e9d1565c3507f07eabc855d814d34efc9213db330e0000000100000fb9
 highlighting uses a value of 100.
                  • strict: boolean that indicates extmark should not be
                    placed if the line or column value is past the end of the
                    buffer or end of the line respectively. Defaults to true.
                  • sign_text: string of length 1-2 used to display in the
                    sign column.
                  • sign_hl_group: highlight group used for the sign column
                    text.
                  • number_hl_group: highlight group used for the number
                    column.
                  • line_hl_group: highlight group used for the whole line.
                  • cursorline_hl_group: highlight group used for the sign
                    column text when the cursor is on the same line as the
                    mark and 'cursorline' is enabled.
                  • conceal: string which should be either empty or a single
                    character. Enable concealing similar to |:syn-conceal|.
                    When a character is supplied it is used as |:syn-cchar|.
                    "hl_group" is used as highlight for the cchar if provided,
                    otherwise it defaults to |hl-Conceal|.
                  • conceal_lines: string which should be empty. When
                    provided, lines in the range are not drawn at all
                    (according to 'conceallevel'); the next unconcealed line
                    is drawn instead.
                  • spell: boolean indicating that spell checking should be
                    performed within this extmark
                  • ui_watched: boolean that indicates the mark should be
                    drawn by a UI. When set, the UI will receive win_extmark
                    events. Note: the mark is positioned by virt_text
                    attributes. Can be used together with virt_text.
                  • url: A URL to associate with this extmark. In the TUI, the
                    OSC 8 control sequence is used to generate a clickable
                    hyperlink to this URL.

    Return: ~
        Id of the created/updated extmark

nvim_create_namespace({name})                        *nvim_create_namespace()*
    Creates a new namespace or gets an existing one.               *namespace*

    Namespaces are used for buffer highlights and virtual text, see
    |nvim_buf_set_extmark()|.

    Namespaces can be named or anonymous. If `name` matches an existing
    namespace, the associated id is returned. If `name` is an empty string a
    new, anonymous namespace is created.

    Attributes: ~
        Since: 0.3.2

    Parameters: ~
      • {name}  Namespace name or empty string

    Return: ~
        Namespace id

nvim_get_namespaces()                                  *nvim_get_namespaces()*
    Gets existing, non-anonymous |namespace|s.

    Attributes: ~
        Since: 0.3.2

    Return: ~
        dict that maps from names to namespace ids.

                                              *nvim_set_decoration_provider()*
nvim_set_decoration_provider({ns_id}, {opts})
    Set or change decoration provider for a |namespace|

    This is a very general purpose interface for having Lua callbacks being
    triggered during the redraw code.

    The expected usage is to set |extmarks| for the currently redrawn buffer.
    |nvim_buf_set_extmark()| can be called to add marks on a per-window or
    per-lines basis. Use the `ephemeral` key to only use the mark for the
    current screen redraw (the callback will be called again for the next
    redraw).

    Note: this function should not be called often. Rather, the callbacks
    themselves can be used to throttle unneeded callbacks. the `on_start`
    callback can return `false` to disable the provider until the next redraw.
    Similarly, return `false` in `on_win` will skip the `on_line` calls for
    that window (but any extmarks set in `on_win` will still be used). A
    plugin managing multiple sources of

Title: nvim_buf_set_extmark Parameters, Namespace Creation, Decoration Provider Setup
Summary
The document continues describing parameters for `nvim_buf_set_extmark`, including 'conceal' for text replacement and highlighting, 'conceal_lines' to hide lines, 'spell' for spell checking within the extmark, 'ui_watched' for UI-drawn marks, and 'url' for clickable hyperlinks. It then covers `nvim_create_namespace` to create named or anonymous namespaces for buffer highlights and virtual text and `nvim_get_namespaces` to get existing namespaces. Finally, it introduces `nvim_set_decoration_provider` for setting up Lua callbacks to be triggered during redraw for setting extmarks, intended for plugin usage.