Skip to content

Commit c0a6274

Browse files
authored
Merge pull request #2 from vim-denops/singleton
Follow denops v0.6
2 parents 721afd5 + d4f7cb9 commit c0a6274

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

denops/helloworld/mod.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { Denops } from "https://deno.land/x/denops@v0.5/denops.ts";
1+
import { Denops } from "https://deno.land/x/denops@v0.6/denops.ts";
22

33
// Start plugin event-loop
4-
Denops.start(async function (denops: Denops): Promise<void> {
4+
Denops.start(async (denops) => {
55
// Register dispatcher
66
denops.extendDispatcher({
77
async echo(text: unknown): Promise<unknown> {
@@ -17,21 +17,21 @@ Denops.start(async function (denops: Denops): Promise<void> {
1717
if (typeof app !== "string") {
1818
throw new Error(`'app' in 'say()' of ${denops.name} must be a string`);
1919
}
20-
const name = await denops.call("input", ["Your name: "]);
20+
const name = await denops.call("input", "Your name: ");
2121
const version = await denops.eval("v:version");
22-
await denops.command("redraw");
23-
await denops.command(
22+
await denops.cmd("redraw");
23+
await denops.cmd(
2424
`echomsg 'Hello ${name}. Your are using ${app} in Vim/Neovim ${version}'`,
2525
);
2626
},
2727
});
2828

2929
// Add command
30-
await denops.command(
30+
await denops.cmd(
3131
`command! DenopsHelloWorldEcho echo denops#request("${denops.name}", "echo", ["This is hello world message"])`,
3232
);
3333

34-
await denops.command(
34+
await denops.cmd(
3535
`command! DenopsHelloWorldSay echo denops#notify("${denops.name}", "say", ["Denops"])`,
3636
);
3737

0 commit comments

Comments
 (0)