Skip to content

Commit 48c529c

Browse files
committed
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.
1 parent f0a44fa commit 48c529c

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

builtin/source/buffer.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { unreachable } from "@core/errorutil/unreachable";
22
import * as fn from "@denops/std/function";
3+
import { getbufinfo } from "@denops/std/helper/getbufinfo";
34

45
import { defineSource, type Source } from "../../source.ts";
56

@@ -44,7 +45,7 @@ type Filter = "buflisted" | "bufloaded" | "bufmodified";
4445
export function buffer(options: Readonly<BufferOptions> = {}): Source<Detail> {
4546
const filter = options.filter;
4647
return defineSource(async function* (denops, _params, { signal }) {
47-
const bufinfo = await fn.getbufinfo(denops);
48+
const bufinfo = await getbufinfo(denops);
4849
signal?.throwIfAborted();
4950

5051
// Filter and map buffers based on the provided filter option

builtin/source/line.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import * as fn from "@denops/std/function";
2+
import { getbufinfo } from "@denops/std/helper/getbufinfo";
23

34
import { defineSource, type Source } from "../../source.ts";
45

@@ -50,7 +51,7 @@ export function line(options: LineOptions = {}): Source<Detail> {
5051
const expr = args[0] ?? "%"; // Defaults to the current buffer if no argument is provided.
5152
await fn.bufload(denops, expr); // Ensure the buffer is loaded.
5253
signal?.throwIfAborted();
53-
const bufinfos = await fn.getbufinfo(denops, expr); // Retrieve buffer information.
54+
const bufinfos = await getbufinfo(denops, expr); // Retrieve buffer information.
5455
signal?.throwIfAborted();
5556
const bufinfo = bufinfos[0];
5657

0 commit comments

Comments
 (0)