Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/denops_std/function/nvim/mod.ts>nvim_buf_set_virtual_text

📚 Standard module for denops.vim
Go to Latest
function nvim_buf_set_virtual_text
import { nvim_buf_set_virtual_text } from "https://deno.land/x/denops_std@v3.6.0/function/nvim/mod.ts";

Set the virtual text (annotation) for a buffer line. By default (and currently the only option) the text will be placed after the buffer text. Virtual text will never cause reflow, rather virtual text will be truncated at the end of the screen line. The virtual text will begin one cell (|lcs-eol| or space) after the ordinary text. Namespaces are used to support batch deletion/updating of virtual text. To create a namespace, use |nvim_create_namespace()|. Virtual text is cleared using |nvim_buf_clear_namespace()|. The same ns_id can be used for both virtual text and highlights added by |nvim_buf_add_highlight()|, both can then be cleared with a single call to |nvim_buf_clear_namespace()|. If the virtual text never will be cleared by an API call, pass ns_id = -1 . As a shorthand, ns_id = 0 can be used to create a new namespace for the virtual text, the allocated id is then returned. Parameters: ~ {buffer} Buffer handle, or 0 for current buffer {ns_id} Namespace to use or 0 to create a namespace, or -1 for a ungrouped annotation {line} Line to annotate with virtual text (zero-indexed) {chunks} A list of [text, hl_group] arrays, each representing a text chunk with specified highlight. hl_group element can be omitted for no highlight. {opts} Optional parameters. Currently not used. Return: ~ The ns_id that was used

Parameters

denops: Denops
buffer: unknown
src_id: unknown
line: unknown
chunks: unknown
opts: unknown

Returns

Promise<unknown>