From 155e7c3a1d22e708bb7628cda5088d8d502e72ef Mon Sep 17 00:00:00 2001 From: mityu Date: Fri, 21 Feb 2025 21:12:48 +0900 Subject: [PATCH 1/2] deps: Upgrade @denops/std to 7.5.0 --- deno.jsonc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deno.jsonc b/deno.jsonc index 3b15f4e..3547d28 100644 --- a/deno.jsonc +++ b/deno.jsonc @@ -114,7 +114,7 @@ "imports": { "@core/errorutil": "jsr:@core/errorutil@^1.2.0", "@core/iterutil": "jsr:@core/iterutil@^0.9.0", - "@denops/std": "jsr:@denops/std@^7.3.0", + "@denops/std": "jsr:@denops/std@^7.5.0", "@denops/test": "jsr:@denops/test@^3.0.4", "@lambdalisue/systemopen": "jsr:@lambdalisue/systemopen@^1.0.0", "@lambdalisue/unnullish": "jsr:@lambdalisue/unnullish@^1.0.2", From bd568d2f970969dc07ee056c30b1e722369d8d87 Mon Sep 17 00:00:00 2001 From: mityu Date: Fri, 21 Feb 2025 21:13:31 +0900 Subject: [PATCH 2/2] fix: Use @denops/std/helper/getbufinfo instead The getbufinfo function in @denops/std/function will raise an error when there's a funcref in buffer-local variables, and we should switch to the alternative getbufinfo function provided by @denops/std/helper/getbufinfo. --- builtin/source/buffer.ts | 5 +++-- builtin/source/line.ts | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/builtin/source/buffer.ts b/builtin/source/buffer.ts index f731f9c..2306d28 100644 --- a/builtin/source/buffer.ts +++ b/builtin/source/buffer.ts @@ -1,5 +1,6 @@ import { unreachable } from "@core/errorutil/unreachable"; -import * as fn from "@denops/std/function"; +import type * as fn from "@denops/std/function"; +import { getbufinfo } from "@denops/std/helper/getbufinfo"; import { defineSource, type Source } from "../../source.ts"; @@ -44,7 +45,7 @@ type Filter = "buflisted" | "bufloaded" | "bufmodified"; export function buffer(options: Readonly = {}): Source { const filter = options.filter; return defineSource(async function* (denops, _params, { signal }) { - const bufinfo = await fn.getbufinfo(denops); + const bufinfo = await getbufinfo(denops); signal?.throwIfAborted(); // Filter and map buffers based on the provided filter option diff --git a/builtin/source/line.ts b/builtin/source/line.ts index 08b849f..71a23de 100644 --- a/builtin/source/line.ts +++ b/builtin/source/line.ts @@ -1,4 +1,5 @@ import * as fn from "@denops/std/function"; +import { getbufinfo } from "@denops/std/helper/getbufinfo"; import { defineSource, type Source } from "../../source.ts"; @@ -50,7 +51,7 @@ export function line(options: LineOptions = {}): Source { const expr = args[0] ?? "%"; // Defaults to the current buffer if no argument is provided. await fn.bufload(denops, expr); // Ensure the buffer is loaded. signal?.throwIfAborted(); - const bufinfos = await fn.getbufinfo(denops, expr); // Retrieve buffer information. + const bufinfos = await getbufinfo(denops, expr); // Retrieve buffer information. signal?.throwIfAborted(); const bufinfo = bufinfos[0];