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_extmark

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

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.) Using the optional arguments, it is possible to use this to highlight a range of text, and also to associate virtual text to the mark. Parameters: ~ {buffer} Buffer handle, or 0 for current buffer {ns_id} Namespace id from |nvim_create_namespace()| {line} Line where to place the mark, 0-based {col} Column where to place the mark, 0-based {opts} Optional parameters. • id : id of the extmark to edit. • end_line : ending line of the mark, 0-based inclusive. • end_col : ending col of the mark, 0-based exclusive. • hl_group : name of the highlight group used to highlight this mark. • virt_text : virtual text to link to this mark. • virt_text_pos : positioning of virtual text. Possible values: • "eol": right after eol character (default) • "overlay": display over the specified column, without shifting the underlying text. • "right_align": display right aligned in the window. • virt_text_win_col : position the virtual text at a fixed window column (starting from the first text column) • virt_text_hide : hide the virtual text when the background text is selected or hidden due to horizontal scroll 'nowrap' • hl_mode : control how highlights are combined with the highlights of the text. Currently only affects virt_text highlights, but might affecthl_groupin later versions. • "replace": only show the virt_text color. This is the default • "combine": combine with background text color • "blend": blend with background text color. • hl_eol : when true, for a multiline highlight covering the EOL of a line, continue the highlight for the rest of the screen line (just like for diff and cursorline highlight). • ephemeral : for use with |nvim_set_decoration_provider| callbacks. The mark will only be used for the current redraw cycle, and not be permantently stored in the buffer. • right_gravity : boolean that indicates the direction the extmark will be shifted in when new text is inserted (true for right, false for left). defaults to true. • end_right_gravity : boolean that indicates the direction the extmark end position (if it exists) will be shifted in when new text is inserted (true for right, false for left). Defaults to false. • priority: a priority value for the highlight group. For example treesitter highlighting uses a value of 100. Return: ~ Id of the created/updated extmark

Parameters

denops: Denops
buffer: unknown
ns_id: unknown
line: unknown
col: unknown
opts: unknown

Returns

Promise<unknown>