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

x/denops_std/buffer/buffer.ts>concrete

📚 Standard module for denops.vim
Latest
function concrete
import { concrete } from "https://deno.land/x/denops_std@v6.5.0/buffer/buffer.ts";

Concrete the buffer.

Vim will discard the content of a non-file buffer when :edit is invoked. Use this function to concrete the content of such buffer to prevent this discard.

import type { Entrypoint } from "https://deno.land/x/denops_std@v6.5.0/mod.ts";
import * as fn from "https://deno.land/x/denops_std@v6.5.0/function/mod.ts";
import { concrete, open, replace } from "https://deno.land/x/denops_std@v6.5.0/buffer/mod.ts";

export const main: Entrypoint = async (denops) => {
  await open(denops, "README.md");
  const bufnr = await fn.bufnr(denops);
  await fn.setbufvar(denops, bufnr, "&buftype", "nofile");
  await replace(denops, bufnr, ["Hello", "World"]);
  await concrete(denops, bufnr);
}

Then :edit on the buffer won't discard the content.

Parameters

denops: Denops
bufnr: number

Returns

Promise<void>