Skip to content

Commit 5892973

Browse files
committed
Revert ":boom: Remove "variables" entry from dict getbufnr() returns"
This reverts commit f2995f7.
1 parent f2995f7 commit 5892973

File tree

2 files changed

+2
-26
lines changed

2 files changed

+2
-26
lines changed

function/buffer.ts

+1-13
Original file line numberDiff line numberDiff line change
@@ -414,9 +414,6 @@ export async function deletebufline(
414414
* name sign name
415415
* variables A reference to the dictionary with
416416
* buffer-local variables.
417-
* CAUTION: Different from the builtin getbufnr()
418-
* function, denops-std's getbufnr() function doesn't
419-
* return this entry.
420417
* windows List of `window-ID`s that display this
421418
* buffer
422419
* popups List of popup `window-ID`s that
@@ -440,10 +437,6 @@ export async function deletebufline(
440437
* Can also be used as a `method`:
441438
*
442439
* GetBufnr()->getbufinfo()
443-
*
444-
* CAUTION: Different from the builtin getbufnr() function, denops-std's
445-
* getbufnr() function omits the "variables" entry from the returned
446-
* dictionary.
447440
*/
448441
export function getbufinfo(
449442
denops: Denops,
@@ -457,12 +450,7 @@ export async function getbufinfo(
457450
denops: Denops,
458451
...args: unknown[]
459452
): Promise<BufInfo[]> {
460-
const bufinfos = await denops.eval(
461-
"map(call('getbufinfo', l:args), {_, v -> filter(v, {k -> k !=# 'variables'})})",
462-
{
463-
args: args,
464-
},
465-
) as Record<
453+
const bufinfos = await denops.call("getbufinfo", ...args) as Record<
466454
keyof BufInfo,
467455
unknown
468456
>[];

function/buffer_test.ts

+1-13
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { assertEquals, assertFalse } from "@std/assert";
1+
import { assertEquals } from "@std/assert";
22
import { assert, is } from "@core/unknownutil";
33
import { test } from "@denops/test";
44
import type { BufInfo } from "./types.ts";
@@ -61,17 +61,5 @@ test({
6161
},
6262
});
6363
await denops.cmd("1,$bwipeout!");
64-
65-
await t.step({
66-
name: "getbufinfo() will filter buffer-local variables",
67-
fn: async () => {
68-
await denops.cmd("enew!");
69-
await denops.cmd("let b:var = 0");
70-
71-
const actual = await buffer.getbufinfo(denops);
72-
assertEquals(actual.length, 1);
73-
assertFalse("variables" in actual[0]);
74-
},
75-
});
7664
},
7765
});

0 commit comments

Comments
 (0)