import { open } from "https://deno.land/x/denops_std@v6.5.0/popup/mod.ts";
Open a popup window showing the buffer in Vim/Neovim compatible way.
import type { Entrypoint } from "https://deno.land/x/denops_std@v6.5.0/mod.ts";
import * as popup from "https://deno.land/x/denops_std@v6.5.0/popup/mod.ts";
export const main: Entrypoint = async (denops) => {
// Open a popup window
const popupWindow = await popup.open(denops, {
relative: "editor",
width: 20,
height: 20,
row: 1,
col: 1,
});
// Do something with the popup window...
// Close the popup window manually
await popupWindow.close();
}
Or with await using
statement:
import type { Entrypoint } from "https://deno.land/x/denops_std@v6.5.0/mod.ts";
import * as popup from "https://deno.land/x/denops_std@v6.5.0/popup/mod.ts";
export const main: Entrypoint = async (denops) => {
// Open a popup window with `await using` statement
await using popupWindow = await popup.open(denops, {
relative: "editor",
width: 20,
height: 20,
row: 1,
col: 1,
});
// Do something with the popup window...
// The popup window is automatically closed, due to `await using` statement
}
Note that this function does NOT work in batch.collect()
.
Parameters
denops: Denops
options: OpenOptions
Returns
Promise<PopupWindow>