Skip to content

Commit

Permalink
Use printError()
Browse files Browse the repository at this point in the history
  • Loading branch information
Shougo committed Apr 15, 2024
1 parent be664a1 commit 231aebf
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions denops/@ddc-sources/shell-native.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ import {
BaseSource,
Context,
Item,
} from "https://deno.land/x/ddc_vim@v3.9.1/types.ts";
import { Denops, fn, op } from "https://deno.land/x/ddc_vim@v3.9.1/deps.ts";
import { TextLineStream } from "https://deno.land/std@0.195.0/streams/mod.ts";
} from "https://deno.land/x/ddc_vim@v5.0.0/types.ts";
import { Denops, fn, op } from "https://deno.land/x/ddc_vim@v5.0.0/deps.ts";
import { printError } from "https://deno.land/x/ddc_vim@v5.0.0/utils.ts";
import { TextLineStream } from "https://deno.land/std@0.222.1/streams/mod.ts";

type Params = {
envs: Record<string, string>;
Expand Down Expand Up @@ -105,16 +106,16 @@ export class Source extends BaseSource<Params> {
return;
}

await args.denops.call(
"ddc#util#print_error",
await printError(
args.denops,
`Run ${shell} is failed with exit code ${s.code}.`,
);
const err = [];
for await (const line of iterLine(proc.stderr)) {
err.push(line);
}
await args.denops.call(
"ddc#util#print_error",
await printError(
args.denops,
err.join("\n"),
);
});
Expand Down

0 comments on commit 231aebf

Please sign in to comment.