import { decorate } from "https://deno.land/x/denops_std@v6.5.1/buffer/decoration.ts";
Decorate the specified buffer with decorations
import type { Entrypoint } from "https://deno.land/x/denops_std@v6.5.1/mod.ts";
import * as fn from "https://deno.land/x/denops_std@v6.5.1/function/mod.ts";
import { decorate, open } from "https://deno.land/x/denops_std@v6.5.1/buffer/mod.ts";
export const main: Entrypoint = async (denops) => {
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.