Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
kamecha committed Dec 12, 2023
1 parent 08f33c2 commit fe0decb
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 5 deletions.
16 changes: 13 additions & 3 deletions denops/traqvim/action.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import { Denops, ensureArray, fn, helper, vars } from "./deps.ts";
import { ChannelBuffer, Message } from "./type.d.ts";
import { activity, channelMessageOptions, channelTimeline, deleteMessage, editMessage } from "./model.ts";
import {
activity,
channelMessageOptions,
channelTimeline,
deleteMessage,
editMessage,
} from "./model.ts";

export const actionOpenChannel = async (
denops: Denops,
Expand Down Expand Up @@ -99,7 +105,7 @@ export const actionDeleteMessage = async (
timeline.filter((m) => m.id !== message.id),
);
await denops.call("traqvim#draw_delete_message", bufNum, message);
}
};

export const actionEditMessage = async (
denops: Denops,
Expand Down Expand Up @@ -134,7 +140,11 @@ export const actionEditMessage = async (
"channelTimeline",
editedTimeline,
);
await denops.call("traqvim#draw_insert_message", bufNum, editedTimeline.find((m) => m.id === message.id));
await denops.call(
"traqvim#draw_insert_message",
bufNum,
editedTimeline.find((m) => m.id === message.id),
);
};

export const actionOpenActivity = async (
Expand Down
13 changes: 11 additions & 2 deletions denops/traqvim/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,12 @@ export async function main(denops: Denops) {
);
ensureNumber(messageBufNum);
// 既存メッセージの内容を描画しておく
await fn.setbufline(denops, messageBufNum, 1, (message as Message).content.split("\n"));
await fn.setbufline(
denops,
messageBufNum,
1,
(message as Message).content.split("\n"),
);
await fn.setbufvar(denops, bufNum, "&splitright", 0);
await fn.setbufvar(
denops,
Expand All @@ -321,7 +326,11 @@ export async function main(denops: Denops) {
);
return;
},
async messageEdit(bufNum: unknown, message: unknown, contents: unknown): Promise<unknown> {
async messageEdit(
bufNum: unknown,
message: unknown,
contents: unknown,
): Promise<unknown> {
ensureNumber(bufNum);
const content = (contents as string[]).join("\n");
await actionEditMessage(denops, message as Message, content, bufNum);
Expand Down

0 comments on commit fe0decb

Please sign in to comment.