Skip to content

Commit 7f2a729

Browse files
committed
👍 Use lambda instead of anonymous
1 parent 88579cf commit 7f2a729

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

denops_std/batch/batch.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,11 +160,11 @@ class BatchHelper implements Denops {
160160
* ```typescript
161161
* import { Denops } from "../mod.ts";
162162
* import { batch } from "./batch.ts";
163-
* import * as anonymous from "../anonymous/mod.ts";
163+
* import * as lambda from "../lambda/mod.ts";
164164
*
165165
* export async function main(denops: Denops): Promise<void> {
166166
* await batch(denops, async (denops) => {
167-
* const [id] = anonymous.add(denops, async () => {
167+
* const id = lambda.register(denops, async () => {
168168
* // This code is called outside of 'batch' block
169169
* // thus the 'denops' instance works like a real one.
170170
* // That's why you can write code like below

denops_std/helper/input.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
assertString,
55
} from "https://deno.land/x/unknownutil@v2.1.0/mod.ts";
66
import * as fn from "../function/mod.ts";
7-
import * as anonymous from "../anonymous/mod.ts";
7+
import * as lambda from "../lambda/mod.ts";
88
import { execute } from "./execute.ts";
99
import { generateUniqueString } from "../util.ts";
1010

@@ -213,7 +213,7 @@ export async function input(
213213
const suffix = await ensurePrerequisites(denops);
214214
const completion = options.completion ?? null;
215215
if (completion && typeof completion !== "string") {
216-
const [id] = anonymous.add(denops, async (arglead, cmdline, cursorpos) => {
216+
const id = lambda.register(denops, async (arglead, cmdline, cursorpos) => {
217217
assertString(arglead);
218218
assertString(cmdline);
219219
assertNumber(cursorpos);
@@ -228,7 +228,7 @@ export async function input(
228228
options.inputsave ?? false,
229229
) as Promise<string | null>;
230230
} finally {
231-
anonymous.remove(denops, id);
231+
lambda.unregister(denops, id);
232232
}
233233
}
234234
if (completion && !fn.isValidBuiltinCompletion(completion)) {

0 commit comments

Comments
 (0)