import { decorate } from "https://deno.land/x/denops_std@v4.1.1/buffer/decoration.ts";
Decorate the specified buffer with decorations
import { Denops } from "../mod.ts";
import * as fn from "../function/mod.ts";
import { decorate, open } from "../buffer/mod.ts";
export async function main(denops: Denops): Promise<void> {
await open(denops, "README.md");
const bufnr = (await fn.bufnr(denops)) as number;
// ...
await decorate(denops, bufnr, [
{
line: 1,
column: 1,
length: 10,
highlight: "Special",
},
{
line: 2,
column: 2,
length: 3,
highlight: "Comment",
},
]);
}
It uses prop_add_list
in Vim and nvim_buf_add_highlight
in Neovim to
decorate the buffer.