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_get_extmarks

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

Gets extmarks in "traversal order" from a |charwise| region defined by buffer positions (inclusive, 0-indexed |api-indexing|). Region can be given as (row,col) tuples, or valid extmark ids (whose positions define the bounds). 0 and -1 are understood as (0,0) and (-1,-1) respectively, thus the following are equivalent: nvim_buf_get_extmarks(0, my_ns, 0, -1, {}) nvim_buf_get_extmarks(0, my_ns, [0,0], [-1,-1], {}) If end is less than start , traversal works backwards. (Useful with limit , to get the first marks prior to a given position.) Example: local a = vim.api local pos = a.nvim_win_get_cursor(0) local ns = a.nvim_create_namespace('my-plugin') -- Create new extmark at line 1, column 1. local m1 = a.nvim_buf_set_extmark(0, ns, 0, 0, 0, {}) -- Create new extmark at line 3, column 1. local m2 = a.nvim_buf_set_extmark(0, ns, 0, 2, 0, {}) -- Get extmarks only from line 3. local ms = a.nvim_buf_get_extmarks(0, ns, {2,0}, {2,0}, {}) -- Get all marks in this buffer + namespace. local all = a.nvim_buf_get_extmarks(0, ns, 0, -1, {}) print(vim.inspect(ms)) Parameters: ~ {buffer} Buffer handle, or 0 for current buffer {ns_id} Namespace id from |nvim_create_namespace()| {start} Start of range, given as (row, col) or valid extmark id (whose position defines the bound) {end} End of range, given as (row, col) or valid extmark id (whose position defines the bound) {opts} Optional parameters. Keys: • limit: Maximum number of marks to return • details Whether to include the details dict Return: ~ List of [extmark_id, row, col] tuples in "traversal order".

Parameters

denops: Denops
buffer: unknown
ns_id: unknown
start: unknown
end: unknown
opts: unknown

Returns

Promise<unknown>