Skip to content

Commit f0bcca1

Browse files
authored
Merge pull request #265 from 4513ECHO/optimize_local_import
💪 Optimize local import
2 parents 49de961 + 0a87c9c commit f0bcca1

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

buffer/buffer.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import * as autocmd from "../autocmd/mod.ts";
55
import * as batch from "../batch/mod.ts";
66
import * as fn from "../function/mod.ts";
77
import * as op from "../option/mod.ts";
8-
import { execute } from "../helper/mod.ts";
8+
import { execute } from "../helper/execute.ts";
99
import {
1010
type FileFormat,
1111
findFileFormat,

buffer/decoration.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { Denops } from "@denops/core";
22
import * as itertools from "@lambdalisue/itertools";
33
import { unreachable } from "@lambdalisue/unreachable";
4-
import * as batch from "../batch/mod.ts";
4+
import { batch } from "../batch/batch.ts";
55
import * as vimFn from "../function/vim/mod.ts";
66
import * as nvimFn from "../function/nvim/mod.ts";
77

@@ -154,7 +154,7 @@ async function vimDecorate(
154154
props.add([deco.line, deco.column, deco.line, deco.column + deco.length]);
155155
decoMap.set(propType, props);
156156
}
157-
await batch.batch(denops, async (denops) => {
157+
await batch(denops, async (denops) => {
158158
for (const highlight of hs) {
159159
const propType = toPropType(highlight);
160160
await vimFn.prop_type_add(denops, propType, {
@@ -184,7 +184,7 @@ async function vimUndecorate(
184184
p.type.startsWith("denops_std:buffer:decoration:decorate:")
185185
).map((p) => p.id),
186186
);
187-
await batch.batch(denops, async (denops) => {
187+
await batch(denops, async (denops) => {
188188
for (const propId of propIds) {
189189
await vimFn.prop_remove(denops, { id: propId, bufnr, all: true });
190190
}
@@ -201,7 +201,7 @@ async function nvimDecorate(
201201
"denops_std:buffer:decoration:decorate",
202202
);
203203
for (const chunk of itertools.chunked(decorations, 1000)) {
204-
await batch.batch(denops, async (denops) => {
204+
await batch(denops, async (denops) => {
205205
for (const deco of chunk) {
206206
await nvimFn.nvim_buf_add_highlight(
207207
denops,

function/getreginfo.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { Denops } from "../mod.ts";
22
import { lessThan } from "@std/semver/less-than";
33
import { parse } from "@std/semver/parse";
44
import { ulid } from "@std/ulid/ulid";
5-
import { execute } from "../helper/mod.ts";
5+
import { execute } from "../helper/execute.ts";
66

77
const cacheKey = "denops_std/function/getreginfo.ts@1";
88

helper/keymap.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { Denops } from "@denops/core";
22
import { isArray } from "@core/unknownutil/is/array";
33
import { isString } from "@core/unknownutil/is/string";
4-
import { batch } from "../batch/mod.ts";
4+
import { batch } from "../batch/batch.ts";
55
import { isRawString, type RawString, rawString } from "../eval/string.ts";
66
import { useEval } from "../eval/use_eval.ts";
77
import { feedkeys } from "../function/mod.ts";

mapping/mod.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66
import type { Denops } from "@denops/core";
77
import * as fn from "../function/mod.ts";
8-
import * as batch from "../batch/mod.ts";
8+
import { batch } from "../batch/batch.ts";
99
import type { Mapping, Mode } from "./types.ts";
1010
import { parse } from "./_parser.ts";
1111

@@ -64,7 +64,7 @@ export async function map(
6464
options.expr ? "<expr>" : "",
6565
options.unique ? "<unique>" : "",
6666
].filter((v) => v).join("");
67-
await batch.batch(denops, async (denops) => {
67+
await batch(denops, async (denops) => {
6868
for (const mode of modes) {
6969
await denops.cmd(`${mode}${prefix}map ${arg} ${lhs} ${rhs}`);
7070
}
@@ -120,7 +120,7 @@ export async function unmap(
120120
): Promise<void> {
121121
const buffer = options.buffer ? "<buffer>" : "";
122122
const modes = forceArray(options.mode ?? "");
123-
await batch.batch(denops, async (denops) => {
123+
await batch(denops, async (denops) => {
124124
for (const mode of modes) {
125125
await denops.cmd(`${mode}unmap ${buffer} ${lhs}`);
126126
}

0 commit comments

Comments
 (0)